import { useState } from 'react'; // @mui import { alpha } from '@mui/material/styles'; import { Box, Divider, Typography, Stack, MenuItem, Avatar } from '@mui/material'; // components import MenuPopover from '@/components/MenuPopover'; import { IconButtonAnimate } from '@/components/animate'; import { useNavigate } from 'react-router-dom'; import useAuth from '@/hooks/useAuth'; import { getUser } from '@/utils/token'; // ---------------------------------------------------------------------- const MENU_OPTIONS = [ { label: 'Home', linkTo: '/', }, // { // label: 'Profile', // linkTo: '/profile', // }, // { // label: 'Settings', // linkTo: '/', // }, ]; // ---------------------------------------------------------------------- export default function AccountPopover() { const [open, setOpen] = useState(null); const navigate = useNavigate(); const { logout } = useAuth(); const handleOpen = (event: React.MouseEvent) => { setOpen(event.currentTarget); }; const handleClose = () => { setOpen(null); }; const handleLogout = () => { logout(); navigate('/auth/login'); }; const userString = getUser(); const storedUser = userString ? JSON.parse(userString) : null; return ( <> alpha(theme.palette.grey[900], 0.8), }, }), }} > Hospital Admin {storedUser?.email} {MENU_OPTIONS.map((option) => ( { handleClose(); navigate(option.linkTo); }} > {option.label} ))} Logout ); }