improved a lot of things

This commit is contained in:
SinachPat
2026-04-26 19:57:18 +01:00
parent bea934d124
commit 3d75fbe09d
12 changed files with 75 additions and 51 deletions
+8 -1
View File
@@ -5,13 +5,20 @@ export type Tool = 'select' | 'pan' | 'artboard' | 'zone';
interface CanvasStore {
activeTool: Tool;
selectedArtboardId: string | null;
/** Workspace/project context set by AppChrome on mount. */
workspaceId: string | null;
projectId: string | null;
setActiveTool: (tool: Tool) => void;
selectArtboard: (id: string | null) => void;
setContext: (workspaceId: string, projectId: string) => void;
}
export const useCanvas = create<CanvasStore>((set) => ({
activeTool: 'select',
selectedArtboardId: 'dashboard-card',
selectedArtboardId: null,
workspaceId: null,
projectId: null,
setActiveTool: (tool) => set({ activeTool: tool }),
selectArtboard: (id) => set({ selectedArtboardId: id }),
setContext: (workspaceId, projectId) => set({ workspaceId, projectId }),
}));