initial scaffold

This commit is contained in:
Boof2015
2026-05-25 21:54:43 -04:00
parent 40c2302d97
commit 9761975af7
40 changed files with 10797 additions and 1 deletions
+30
View File
@@ -0,0 +1,30 @@
import { create } from 'zustand';
import type { Album, Artist, DbTrack } from '@/types/library';
/**
* Library state — minimal M0 stub. Real on-device scanning + SQLite (op-sqlite)
* land at M1; the shapes here mirror desktop `libraryStore` so that work slots in.
*/
type ViewMode = 'tracks' | 'albums' | 'artists' | 'folders';
interface LibraryStore {
tracks: DbTrack[];
albums: Album[];
artists: Artist[];
totalTrackCount: number;
viewMode: ViewMode;
isScanning: boolean;
setViewMode: (mode: ViewMode) => void;
}
export const useLibraryStore = create<LibraryStore>((set) => ({
tracks: [],
albums: [],
artists: [],
totalTrackCount: 0,
viewMode: 'albums',
isScanning: false,
setViewMode: (viewMode) => set({ viewMode }),
}));