ubiquitous-invention/apps/web/lib/stores/workspace-store.ts

18 lines
416 B
TypeScript
Raw Permalink Normal View History

import { create } from "zustand";
export interface WorkspaceInfo {
id: string;
slug: string;
name: string;
}
interface WorkspaceState {
currentWorkspace: WorkspaceInfo | null;
setWorkspace: (workspace: WorkspaceInfo | null) => void;
}
export const useWorkspaceStore = create<WorkspaceState>((set) => ({
currentWorkspace: null,
setWorkspace: (workspace) => set({ currentWorkspace: workspace }),
}));