import { useCallback } from 'react'; import { useRouter } from 'next/navigation'; import PropTypes from 'prop-types'; import { Box, Divider, MenuItem, MenuList, Popover, Typography } from '@mui/material'; import { useAuth } from 'src/hooks/use-auth'; export const AccountPopover = (props) => { const { anchorEl, onClose, open } = props; const router = useRouter(); const auth = useAuth(); const handleSignOut = useCallback( () => { onClose?.(); auth.signOut(); router.push('/auth/login'); }, [onClose, auth, router] ); return ( Account Anika Visser *': { borderRadius: 1 } }} > Sign out ); }; AccountPopover.propTypes = { anchorEl: PropTypes.any, onClose: PropTypes.func, open: PropTypes.bool.isRequired };