26 lines
693 B
TypeScript
26 lines
693 B
TypeScript
"use client";
|
|
import type { MenuItem } from "@common/components/api";
|
|
import { NoFooterLayout } from "@common/components/ui";
|
|
import { usePathname,useRouter } from "next/navigation";
|
|
import { useWrStore } from "../store";
|
|
|
|
export default function RootLayout({
|
|
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 (
|
|
<NoFooterLayout currentPath={pathname ?? ""} handleMenuClick={changeMenu}>
|
|
{children}
|
|
</NoFooterLayout>
|
|
);
|
|
}
|