23 lines
555 B
TypeScript
23 lines
555 B
TypeScript
"use client";
|
|
|
|
import { BaseLayout } from "@common/components";
|
|
import type { MenuItem } from "./store/common";
|
|
import { useFoStore } from "./store";
|
|
import { useRouter } from "next/navigation";
|
|
|
|
export default function Base({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
}>) {
|
|
const { getMenuAuth } = useFoStore((state) => state);
|
|
|
|
const router = useRouter();
|
|
const handleClick = (id:MenuItem) =>{
|
|
getMenuAuth(id.menuCd);
|
|
router.push(id.urlPath);
|
|
}
|
|
|
|
return <BaseLayout handleMenuClick={handleClick}>{children}</BaseLayout>;
|
|
}
|