Files
astra-mobile/src/components/library/ViewModeSwitcher.tsx
T
2026-07-03 23:56:34 -04:00

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)}
/>
);
}