diff --git a/packages/smarthr-ui/src/components/AppHeader/components/desktop/Navigation.tsx b/packages/smarthr-ui/src/components/AppHeader/components/desktop/Navigation.tsx index c40249c5c8..cc5108a464 100644 --- a/packages/smarthr-ui/src/components/AppHeader/components/desktop/Navigation.tsx +++ b/packages/smarthr-ui/src/components/AppHeader/components/desktop/Navigation.tsx @@ -64,30 +64,31 @@ const buildNavigations = ( navigations: NavigationType[], ): ComponentProps['children'] => ( <> - {navigations.map((navigation) => { + {navigations.map((navigation, index) => { if ('elementAs' in navigation) { + const { elementAs, ...rest } = navigation return ( ) } if ('href' in navigation) { - return + return } if ('childNavigations' in navigation) { return ( {buildDropdownMenu(navigation.childNavigations)} ) } - return + return })} ) @@ -96,43 +97,49 @@ const buildDropdownMenu = ( navigations: Array, ): ComponentProps['children'] => ( <> - {navigations.map((navigation) => { + {navigations.map((navigation, index) => { if ('elementAs' in navigation) { - const Component = navigation.elementAs + const { elementAs: Component, current, className, ...rest } = navigation // TODO: DropdownMenuItemを作成し、elementAsを渡せるようにする return ( ) } if ('href' in navigation) { + const { current, ...rest } = navigation return ( ) } if ('title' in navigation) { return ( - + {buildDropdownMenu(navigation.childNavigations)} ) } + const { current, ...rest } = navigation return (