feat(store): add Zustand store for setting navigation persistence

This commit is contained in:
cfngc4594 2025-03-03 15:38:06 +08:00
parent 4f7f367320
commit 30f12d0cd7

View File

@ -0,0 +1,19 @@
import { create } from "zustand";
import { persist } from "zustand/middleware";
interface SettingNavState {
activeNav: string;
setActiveNav: (nav: string) => void;
}
export const useSettingNavStore = create<SettingNavState>()(
persist(
(set) => ({
activeNav: "Messages & media",
setActiveNav: (nav) => set({ activeNav: nav }),
}),
{
name: "setting-nav-active",
}
)
);