Spaces:
Sleeping
Sleeping
File size: 606 Bytes
b3d14e3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | import { create } from "zustand";
export type AppView = "design" | "sweep" | "pareto" | "shap";
interface ViewState {
view: AppView;
setView: (view: AppView) => void;
}
/**
* Top-level navigation state.
*
* Trivial Zustand store rather than a router because the whole app
* is currently a 2-tab interface and pulling in `react-router-dom`
* for that would be over-kill. If we add per-route URLs (sharable
* deep links into a sweep config) we'll switch to a real router.
*/
export const useViewStore = create<ViewState>()((set) => ({
view: "design",
setView: (view) => set({ view }),
}));
|