dm_new menu

This commit is contained in:
dongsilove
2026-02-18 22:11:12 +09:00
parent f621f4dfa1
commit 7a91fcbd80
74 changed files with 9010 additions and 13 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ export { getCookie, setCookie, removeCookie } from "./cookie";
// export { useMutationWrapper } from "./use-mutation-wrapper";
// export { useAlertStore } from "./use-alert-store";
// export { useDataTable } from "./use-data-table";
// export { useMenuStore } from "./use-menu-store";
export { useMenuStore } from "./use-menu-store";
// export { useUserStore } from "./use-user-store";
// export { usePrompt } from "./use-prompt";
// export { useSelectPrompt } from "./use-select-prompt";
@@ -0,0 +1,14 @@
import { useStore } from "zustand";
import { useContext } from "react";
import type { MenuStore } from "../store/menu-store";
import { StoreContext } from "../providers/store-provider";
export const useMenuStore = <T>(selector: (store: MenuStore) => T): T => {
const storeContext = useContext(StoreContext);
if (!storeContext) {
throw new Error("useMenuStore must be used within StoreProvider");
}
return useStore(storeContext.menuStore, selector);
};