currentPath 추가

This commit is contained in:
2025-07-26 16:07:19 +09:00
parent 2aba7bb16e
commit 5c7a8df55f
3 changed files with 35 additions and 23 deletions
+10 -5
View File
@@ -3,7 +3,7 @@
import { BaseLayout } from "@common/components";
import type { MenuItem } from "./store/common";
import { useFoStore } from "./store";
import { useRouter } from "next/navigation";
import { usePathname, useRouter } from "next/navigation";
export default function Base({
children,
@@ -11,12 +11,17 @@ export default function Base({
children: React.ReactNode;
}>) {
const { getMenuAuth } = useFoStore((state) => state);
const pathname = usePathname();
const router = useRouter();
const handleClick = (id:MenuItem) =>{
const handleClick = (id: MenuItem) => {
getMenuAuth(id.menuCd);
router.push(id.urlPath);
}
};
return <BaseLayout handleMenuClick={handleClick}>{children}</BaseLayout>;
return (
<BaseLayout currentPath={pathname ?? ""} handleMenuClick={handleClick}>
{children}
</BaseLayout>
);
}