Feat: 폴더 관리를 위한 스토어 추가
This commit is contained in:
parent
3a12570548
commit
b080da3549
22
frontend/src/stores/useFolderStore.ts
Normal file
22
frontend/src/stores/useFolderStore.ts
Normal 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;
|
Loading…
Reference in New Issue
Block a user