feat: drawers registry

This commit is contained in:
2025-08-22 17:04:59 +04:00
parent cb67c913ad
commit b5753ed3a2
28 changed files with 680 additions and 285 deletions

View File

@ -8,12 +8,11 @@ import { ProjectSchema, UpdateProjectSchema } from "@/lib/client";
type ProjectsContextState = {
selectedProject: ProjectSchema | null;
setSelectedProjectId: React.Dispatch<React.SetStateAction<number | null>>;
refetchProjects: () => Promise<void>;
projects: ProjectSchema[];
onCreateProject: (name: string) => void;
onUpdateProject: (projectId: number, project: UpdateProjectSchema) => void;
onDeleteProject: (project: ProjectSchema) => void;
isEditorDrawerOpened: boolean;
setIsEditorDrawerOpened: React.Dispatch<React.SetStateAction<boolean>>;
};
const ProjectsContext = createContext<ProjectsContextState | undefined>(
@ -21,8 +20,6 @@ const ProjectsContext = createContext<ProjectsContextState | undefined>(
);
const useProjectsContextState = () => {
const [isEditorDrawerOpened, setIsEditorDrawerOpened] =
useState<boolean>(false);
const {
projects,
setProjects,
@ -49,12 +46,11 @@ const useProjectsContextState = () => {
return {
projects,
selectedProject,
refetchProjects,
setSelectedProjectId,
onCreateProject,
onUpdateProject,
onDeleteProject,
isEditorDrawerOpened,
setIsEditorDrawerOpened,
};
};