mirror of
https://github.com/Boof2015/astra-mobile.git
synced 2026-08-19 12:14:47 +02:00
28 lines
706 B
TypeScript
28 lines
706 B
TypeScript
import { SegmentedControl } from '@/components/SegmentedControl';
|
|
|
|
export type LibraryViewMode = 'albums' | 'artists' | 'tracks' | 'playlists' | 'folders';
|
|
|
|
const MODES: { key: LibraryViewMode; label: string }[] = [
|
|
{ key: 'albums', label: 'Albums' },
|
|
{ key: 'artists', label: 'Artists' },
|
|
{ key: 'tracks', label: 'Tracks' },
|
|
{ key: 'playlists', label: 'Playlists' },
|
|
{ key: 'folders', label: 'Folders' },
|
|
];
|
|
|
|
export function ViewModeSwitcher({
|
|
value,
|
|
onChange,
|
|
}: {
|
|
value: LibraryViewMode;
|
|
onChange: (mode: LibraryViewMode) => void;
|
|
}) {
|
|
return (
|
|
<SegmentedControl
|
|
segments={MODES}
|
|
value={value}
|
|
onChange={(key) => onChange(key as LibraryViewMode)}
|
|
/>
|
|
);
|
|
}
|