frontend/containers/EventBar/UserIcon.tsx (view raw)
1import Avatar from '@mui/material/Avatar';
2import AccountCircleOutlinedIcon from '@mui/icons-material/AccountCircleOutlined';
3import useProfile from '../../hooks/useProfile';
4import theme from '../../theme';
5
6const UserIcon = () => {
7 const {profile} = useProfile();
8
9 if (profile)
10 return (
11 <Avatar
12 sx={{width: theme.spacing(3), height: theme.spacing(3), fontSize: 16}}
13 >
14 {`${profile.username[0]}`.toUpperCase()}
15 </Avatar>
16 );
17 else return <AccountCircleOutlinedIcon />;
18};
19
20export default UserIcon;