35 lines
910 B
TypeScript
35 lines
910 B
TypeScript
'use client'
|
|
import { NoFooterLayout } from "@common/components";
|
|
import { useQueryClient } from "@tanstack/react-query";
|
|
import type { MenuItem } from "../../store/common";
|
|
import { useFoStore } from "../../store";
|
|
import { usePathname, useRouter } from "next/navigation";
|
|
import { authService } from "@/src/entities/auth";
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
}>) {
|
|
|
|
const { getMenuAuth } = useFoStore((state) => state);
|
|
const pathname = usePathname();
|
|
const router = useRouter();
|
|
const queryClient = useQueryClient();
|
|
|
|
const handleClick = (id: MenuItem) => {
|
|
getMenuAuth(id.menuCd);
|
|
router.push(id.urlPath);
|
|
};
|
|
return (
|
|
<NoFooterLayout
|
|
queryClient={queryClient}
|
|
authService={authService}
|
|
currentPath={pathname ?? ""}
|
|
handleMenuClick={handleClick}
|
|
>
|
|
{children}
|
|
</NoFooterLayout>
|
|
);
|
|
}
|