2020-08-17 19:21:14 +02:00
|
|
|
import { Menu, MenuItem } from '@material-ui/core';
|
|
|
|
import React, { FC } from 'react';
|
2020-06-10 21:40:33 +02:00
|
|
|
|
|
|
|
interface ProfileProps {
|
2020-08-17 19:21:14 +02:00
|
|
|
anchorEl: HTMLElement | null;
|
|
|
|
handleClose: () => void;
|
|
|
|
handleLogout: () => void;
|
2020-06-10 21:40:33 +02:00
|
|
|
}
|
|
|
|
|
2020-08-17 19:21:14 +02:00
|
|
|
export const Profile: FC<ProfileProps> = ({ anchorEl, handleClose, handleLogout, ...restProps }) => {
|
|
|
|
return (
|
|
|
|
<Menu
|
|
|
|
className="top-bar__menu"
|
|
|
|
id="simple-menu"
|
|
|
|
anchorEl={anchorEl}
|
|
|
|
keepMounted
|
|
|
|
open={Boolean(anchorEl)}
|
|
|
|
onClose={handleClose}
|
|
|
|
>
|
|
|
|
<MenuItem>Profile</MenuItem>
|
|
|
|
<MenuItem>My account</MenuItem>
|
|
|
|
<MenuItem
|
|
|
|
onClick={() => {
|
|
|
|
handleLogout();
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
Logout
|
|
|
|
</MenuItem>
|
|
|
|
</Menu>
|
|
|
|
);
|
2020-06-10 21:40:33 +02:00
|
|
|
};
|