Files
frontend/apps/wr/app/base.tsx
T
2025-07-26 16:07:19 +09:00

26 lines
753 B
TypeScript

"use client";
import { BaseLayout } from "@common/components/ui";
import { useWrStore } from "./store";
import { MainDiv } from "@common/business_components/ui";
import type { MenuItem } from "./store/common/type/menu";
import { usePathname, useRouter } from "next/navigation";
export default function Base({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const { getMenuAuthrts } = useWrStore((state) => state);
const router = useRouter();
const pathname = usePathname();
const changeMenu = (path: MenuItem) => {
getMenuAuthrts(path.menuCd);
router.push(path.urlPath);
};
return (
<BaseLayout currentPath={pathname ?? ""} handleMenuClick={changeMenu}>
<MainDiv>{children}</MainDiv>
</BaseLayout>
);
}