feat: drawers registry
This commit is contained in:
@ -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,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user