import Link from 'next/link'; import Drawer from '@mui/material/Drawer'; import Box from '@mui/material/Box'; import {useTheme} from '@mui/material/styles'; import {useTranslation} from 'react-i18next'; import {useRouter} from 'next/router'; import useProfile from '../../hooks/useProfile'; import DrawerMenuItem from './DrawerMenuItem'; import useEventStore from '../../stores/useEventStore'; interface Props { eventUuid: string; } const DrawerMenu = ({eventUuid}: Props) => { const {t} = useTranslation(); const theme = useTheme(); const event = useEventStore(s => s.event); const {connected} = useProfile(); const appLink = connected ? '/dashboard' : `/e/${eventUuid}` || ''; const isCarosterPlusEvent = event?.enabled_modules?.includes('caroster-plus'); const router = useRouter(); const { query: {uuid}, } = router; return ( Logo { router.push(`/e/${uuid}`, null, {shallow: true}); }} icon="directions_car" active={router.pathname === `/e/[uuid]`} /> {isCarosterPlusEvent && connected && ( router.push(`/e/${uuid}/alerts`, null, {shallow: true}) } icon="track_changes" active={router.pathname === `/e/[uuid]/alerts`} /> )} {!isCarosterPlusEvent && ( router.push(`/e/${uuid}/waitingList`, null, {shallow: true}) } icon="group" active={ router.pathname === `/e/[uuid]/waitingList` || router.pathname === `/e/[uuid]/assign/[passengerId]` } /> )} { router.push(`/e/${uuid}/details`, null, {shallow: true}); }} icon="info" active={router.pathname === `/e/[uuid]/details`} /> { router.push(`/e/${uuid}/options`, null, {shallow: true}); }} icon="settings" active={router.pathname === `/e/[uuid]/options`} /> ); }; export default DrawerMenu;