From 396acf3bbbe00a192cb0ea0a9ccf91b1d8d2850b Mon Sep 17 00:00:00 2001 From: Fuwn <50817549+Fuwn@users.noreply.github.com> Date: Sat, 24 Jan 2026 13:09:50 +0000 Subject: Initial commit Created from https://vercel.com/new --- src/store/dashboard.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/store/dashboard.ts (limited to 'src/store/dashboard.ts') diff --git a/src/store/dashboard.ts b/src/store/dashboard.ts new file mode 100644 index 0000000..93f59ed --- /dev/null +++ b/src/store/dashboard.ts @@ -0,0 +1,22 @@ +import { create } from 'zustand'; +import { DASHBOARD_CONFIG, DEFAULT_WEBSITE_LIMIT } from '@/lib/constants'; +import { getItem, setItem } from '@/lib/storage'; + +export const initialState = { + showCharts: true, + limit: DEFAULT_WEBSITE_LIMIT, + websiteOrder: [], + websiteActive: [], + editing: false, + isEdited: false, +}; + +const store = create(() => ({ ...initialState, ...getItem(DASHBOARD_CONFIG) })); + +export function saveDashboard(settings) { + store.setState(settings); + + setItem(DASHBOARD_CONFIG, store.getState()); +} + +export const useDashboard = store; -- cgit v1.2.3