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

29 lines
660 B
TypeScript

"use client";
import { BaseLayout } from "@common/components";
import type { MenuItem } from "./store/common";
import { useDmStore } from "./store";
import { usePathname, useRouter } from "next/navigation";
export default function Base({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const { getMenuAuth } = useDmStore((state) => state);
const router = useRouter();
const pathname = usePathname();
const handleClick = (id: MenuItem) => {
getMenuAuth(id.menuCd);
router.push(id.urlPath);
};
return (
<BaseLayout currentPath={pathname ?? ""} handleMenuClick={handleClick}>
{children}
</BaseLayout>
);
}