feat: 기본 레이아웃 설정, 스타일 설정, 메뉴 세팅 (ui는 kamco 프로젝트 기반)
This commit is contained in:
22
web-app/app/shared/components/menu/LayoutMenu.tsx
Normal file
22
web-app/app/shared/components/menu/LayoutMenu.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { useCallback } from 'react';
|
||||
import { useLocation, useNavigate } from 'react-router';
|
||||
|
||||
import { Menu, type MenuItemChildrenType, type MenuItemType } from './Menu';
|
||||
|
||||
interface Props {
|
||||
items: MenuItemType[];
|
||||
}
|
||||
|
||||
export const LayoutMenu = ({ items }: Props) => {
|
||||
const { pathname } = useLocation();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const onSelectionChange = useCallback(
|
||||
(menu: MenuItemChildrenType) => {
|
||||
navigate(menu.menuUrl);
|
||||
},
|
||||
[navigate],
|
||||
);
|
||||
|
||||
return <Menu currentPath={pathname} items={items} onSelectionChange={onSelectionChange} />;
|
||||
};
|
||||
Reference in New Issue
Block a user