Feat: 폴더 관리를 위한 스토어 추가

This commit is contained in:
정현조 2024-09-12 10:58:38 +09:00
parent 3a12570548
commit b080da3549

View File

@ -0,0 +1,22 @@
import { create } from 'zustand';
import { FolderResponseDTO } from '@/types';
interface FolderState {
folder: FolderResponseDTO | null;
loading: boolean;
error: string | null;
setFolder: (folder: FolderResponseDTO | null) => void;
setLoading: (loading: boolean) => void;
setError: (error: string | null) => void;
}
const useFolderStore = create<FolderState>((set) => ({
folder: null,
loading: false,
error: null,
setFolder: (folder) => set({ folder }),
setLoading: (loading) => set({ loading }),
setError: (error) => set({ error }),
}));
export default useFolderStore;