feat: page title 컴포넌트 생성

This commit is contained in:
2025-03-31 13:09:05 +09:00
parent 7860345e89
commit 0aee493d32
12 changed files with 120 additions and 15 deletions
+2
View File
@@ -1 +1,3 @@
export { createAlertStore } from "./alert-store";
export { createMenuStore } from "./menu-store";
export { createUserStore, type IUserInfo } from "./user-store";
+23
View File
@@ -0,0 +1,23 @@
import { createStore } from "zustand/vanilla";
import type { MenuItem } from "@common/components/api";
export type MenuState = {
currentMenuInfo: MenuItem | null;
};
export type MenuActions = {
setCurrentMenuInfo: (menu: MenuItem) => void;
};
export type MenuStore = MenuState & MenuActions;
export const defaultInitState: MenuState = {
currentMenuInfo: null,
};
export const createMenuStore = (initState: MenuState = defaultInitState) => {
return createStore<MenuStore>()((set) => ({
...initState,
setCurrentMenuInfo: (menu: MenuItem) => set({ currentMenuInfo: menu }),
}));
};