import { useValues } from 'kea' ; import { EuiSideNavItemType } from '@elastic/eui' ; import { generateNavLink } from '../../../../shared/layout' ; import { NAV } from '../../../constants' ; import { getGroupPath , getGroupSourcePrioritizationPath } from '../../../routes' ; import { GroupLogic } from '../group_logic' ; export const useGroupSubNav = ( ) => { const { group : { id } , } = useValues ( GroupLogic ) ; if ( ! id ) return undefined ; const navItems = [ { id : 'groupOverview' , name : NAV . GROUP_OVERVIEW , ... generateNavLink ( { to : getGroupPath ( id ) } ) , } , { id : 'groupSourcePrioritization' , name : NAV . SOURCE_PRIORITIZATION , ... generateNavLink ( { to : getGroupSourcePrioritizationPath ( id ) } ) , } , ] ; return navItems ; } ;