25 lines
664 B
TypeScript
25 lines
664 B
TypeScript
"use client"
|
|
import { BaseLayout } from "@common/components/ui"
|
|
import { useWrStore } from "./store"
|
|
import { MainDiv } from "@common/business_components/ui"
|
|
import type { MenuItem } from "./store/common/type/menu"
|
|
import { useRouter } from "next/navigation"
|
|
export default function Base({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode
|
|
}>) {
|
|
const { getMenuAuthrts } = useWrStore((state) => state)
|
|
const router = useRouter()
|
|
|
|
const changeMenu = (path: MenuItem) => {
|
|
getMenuAuthrts(path.menuCd)
|
|
router.push(path.urlPath)
|
|
}
|
|
return (
|
|
<BaseLayout handleMenuClick={changeMenu}>
|
|
<MainDiv>{children}</MainDiv>
|
|
</BaseLayout>
|
|
)
|
|
}
|