import NextLink from 'next/link'; import { usePathname } from 'next/navigation'; import PropTypes from 'prop-types'; import Link from 'next/link' import { Box, Button, Divider, Drawer, Stack, SvgIcon, Typography, useMediaQuery } from '@mui/material'; import { Logo } from 'src/components/logo'; import { Scrollbar } from 'src/components/scrollbar'; import { items } from './config'; import { SideNavItem } from './side-nav-item'; import { useTheme } from '@mui/material'; export const SideNav = (props) => { const { open, onClose } = props; const pathname = usePathname(); const lgUp = useMediaQuery((theme) => theme.breakpoints.up('lg')); const theme = useTheme(); const isItemActive = (currentPath, itemPath) => { if (currentPath === itemPath) { return true; } if (currentPath.includes(itemPath) && itemPath !== '/') { return true; } return false; } const content = (
{items.map((item) => { if (item.title == "Map" && process.env.NEXT_PUBLIC_ENTERPRISE_VERSION != "true"){ return } const active = isItemActive(pathname, item.path); return ( ); })} Powered by Oktopus logo image
); if (lgUp) { return ( {content} ); } return ( theme.zIndex.appBar + 100 }} variant="temporary" > {content} ); }; SideNav.propTypes = { onClose: PropTypes.func, open: PropTypes.bool };