// ───────────────────────────────────────────────────────────────────────────── // features/home/store/dashboardStore.ts // // Client-side UI state for the Home feature. // Use Zustand for state that lives only in the browser (filters, selections, // UI toggles) and React Query for state that originates from the server. // ───────────────────────────────────────────────────────────────────────────── import { create } from 'zustand'; interface DashboardStore { /** Active tab in the data section */ activeTab: string; setActiveTab: (tab: string) => void; /** Whether the stats section is expanded */ statsExpanded: boolean; toggleStats: () => void; } export const useDashboardStore = create(set => ({ activeTab: 'overview', setActiveTab: tab => set({ activeTab: tab }), statsExpanded: true, toggleStats: () => set(state => ({ statsExpanded: !state.statsExpanded })), }));