- CreateItemDialog: shared Zustand store for dialog state - TopBar: use store instead of router.push navigation - TaskDetailPanel: dynamic domain fetch from /api/domains - TodayTasksWidget: domain name resolution from UUIDs - ProjectProgressWidget: fetch real progress, default to 0 - Calendar page: domain filter fetches from API dynamically - Habits page: edit/delete dropdown with AlertDialog - Projects page: domain name display + delete button - Notes page: domain picker on creation, names in list - Settings domains: add color picker input - Tasks list view: MoreHorizontal wired to edit/delete - HabitCard: domain resolution + edit/delete dropdown - PocketBase compat: add JSDoc migration comment
18 lines
448 B
TypeScript
18 lines
448 B
TypeScript
import { create } from "zustand";
|
|
|
|
type ItemType = "task" | "project" | "habit" | null;
|
|
|
|
interface CreateDialogState {
|
|
type: ItemType;
|
|
open: boolean;
|
|
openCreate: (type: ItemType) => void;
|
|
closeCreate: () => void;
|
|
}
|
|
|
|
export const useCreateDialogStore = create<CreateDialogState>((set) => ({
|
|
type: null,
|
|
open: false,
|
|
openCreate: (type: ItemType) => set({ type, open: true }),
|
|
closeCreate: () => set({ type: null, open: false }),
|
|
}));
|