import { useTranslation } from 'react-i18next'; import { Download, FileUp, HardDrive, Lightbulb, Search } from 'lucide-react'; import { usePlaylistLayoutStore, type PlaylistLayoutItemId } from '@/store/playlistLayoutStore'; const PLAYLIST_LAYOUT_ICONS: Record = { addSongs: Search, importCsv: FileUp, downloadZip: Download, offlineCache: HardDrive, suggestions: Lightbulb, }; const PLAYLIST_LAYOUT_LABEL_KEYS: Record = { addSongs: 'playlists.addSongs', importCsv: 'playlists.importCSV', downloadZip: 'playlists.downloadZip', offlineCache: 'playlists.cacheOffline', suggestions: 'playlists.suggestions', }; export function PlaylistLayoutCustomizer() { const { t } = useTranslation(); const items = usePlaylistLayoutStore(s => s.items); const toggleItem = usePlaylistLayoutStore(s => s.toggleItem); return (
{items.map((it) => { const Icon = PLAYLIST_LAYOUT_ICONS[it.id]; const label = t(PLAYLIST_LAYOUT_LABEL_KEYS[it.id]); return (
{label}
); })}
); }