import { create } from 'zustand';

interface FileBrowserState {
  viewMode: 'grid' | 'list';
  setViewMode: (mode: 'grid' | 'list') => void;
  selectedFolderId: string | null | undefined; // undefined = no selection, null = root
  setSelectedFolderId: (id: string | null | undefined) => void;
}

export const useFileBrowserStore = create<FileBrowserState>((set) => ({
  viewMode: 'list',
  setViewMode: (viewMode) => set({ viewMode }),
  selectedFolderId: undefined,
  setSelectedFolderId: (selectedFolderId) => set({ selectedFolderId }),
}));
