import { FC, useState, useContext } from 'react'; import { Box, Button, Divider, IconButton, Popover, Typography, Avatar, styled, TypographyProps } from '@mui/material'; import PersonIcon from '@mui/icons-material/Person'; import AccountCircleIcon from '@mui/icons-material/AccountCircle'; import { AuthenticatedContext } from '../../contexts/authentication'; const ItemTypography = styled(Typography)({ maxWidth: '250px', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }); const LayoutAuthMenu: FC = () => { const { me, signOut } = useContext(AuthenticatedContext); const [anchorEl, setAnchorEl] = useState(null); const handleClick = (event: React.MouseEvent) => { setAnchorEl(event.currentTarget); }; const handleClose = () => { setAnchorEl(null); }; const open = Boolean(anchorEl); const id = anchorEl ? 'app-menu-popover' : undefined; return ( <> {me.username} {me.admin ? 'Admin User' : 'Guest User'} ); }; export default LayoutAuthMenu;