import {useState} from 'react'; import AppBar from '@mui/material/AppBar'; import Toolbar from '@mui/material/Toolbar'; import Typography from '@mui/material/Typography'; import IconButton from '@mui/material/IconButton'; import Tooltip from '@mui/material/Tooltip'; import Icon from '@mui/material/Icon'; import Box from '@mui/material/Box'; import {useTheme} from '@mui/styles'; import useShare from '../../hooks/useShare'; import GenericMenu from '../GenericMenu'; import useActions from './useActions'; import UserIcon from './UserIcon'; import {useSession} from 'next-auth/react'; import DrawerNotification from '../DrawerNotification'; const EventBar = ({event, onAdd, goBack, title}) => { const session = useSession(); const isAuthenticated = session.status === 'authenticated'; const theme = useTheme(); const {share} = useShare(); const [anchorEl, setAnchorEl] = useState(null); const menuActions = useActions({onAdd, eventId: event?.id}); return ( {goBack && ( chevron_left )} {title || event.name} <> share({ title: `Caroster ${event.name}`, }) } size="large" > share {isAuthenticated && } setAnchorEl(e.currentTarget)} size="large" > ); }; export default EventBar;