11import { Button , Icon , Menu } from '@equinor/eds-core-react'
2+ import { useInstallationContext } from 'components/Contexts/InstallationContext'
23import { useLanguageContext } from 'components/Contexts/LanguageContext'
34import { config } from 'config'
45import { useState } from 'react'
@@ -13,6 +14,7 @@ const StyledButton = styled(Button)`
1314
1415export const NavigationMenu = ( ) => {
1516 const { TranslateText } = useLanguageContext ( )
17+ const { installationInspectionAreas } = useInstallationContext ( )
1618 const [ isOpen , setIsOpen ] = useState ( false )
1719 const [ anchorEl , setAnchorEl ] = useState ( null )
1820 const openMenu = ( ) => {
@@ -22,14 +24,23 @@ export const NavigationMenu = () => {
2224 setIsOpen ( false )
2325 }
2426
25- const paths = [
26- { path : 'missionControl' , label : 'Mission Control' } ,
27- { path : 'history' , label : 'Mission History' } ,
28- { path : 'inspectionOverview' , label : 'Deck Overview' } ,
29- { path : 'predefinedMissions' , label : 'Predefined Missions' } ,
30- { path : 'autoSchedule' , label : 'Auto Scheduling' } ,
31- { path : 'robots' , label : 'Robots' } ,
32- ]
27+ const paths =
28+ installationInspectionAreas . length > 1
29+ ? [
30+ { path : 'missionControl' , label : 'Mission Control' } ,
31+ { path : 'history' , label : 'Mission History' } ,
32+ { path : 'inspectionOverview' , label : 'Deck Overview' } ,
33+ { path : 'predefinedMissions' , label : 'Predefined Missions' } ,
34+ { path : 'autoSchedule' , label : 'Auto Scheduling' } ,
35+ { path : 'robots' , label : 'Robots' } ,
36+ ]
37+ : [
38+ { path : 'missionControl' , label : 'Mission Control' } ,
39+ { path : 'history' , label : 'Mission History' } ,
40+ { path : 'predefinedMissions' , label : 'Predefined Missions' } ,
41+ { path : 'autoSchedule' , label : 'Auto Scheduling' } ,
42+ { path : 'robots' , label : 'Robots' } ,
43+ ]
3344
3445 const navigate = useNavigate ( )
3546 const routeChange = ( routePath : string ) => {
0 commit comments