import React, { FC } from 'react'; import styled from 'styled-components'; import { Button, Card, CardContent, CardMedia, Dialog, IconButton, Typography, } from '@material-ui/core'; import { Close, ExitToApp } from '@material-ui/icons'; import { User } from './userSlice'; type UserProfileProps = { handleClose: (signOut?: boolean) => void; open: boolean; } & User['profile'] & Pick; const StyledCard = styled(Card)` display: flex; margin: auto; max-width: 345px; `; const Details = styled.div` display: flex; flex-direction: column; `; const Controls = styled.div` display: flex; align-items: center; padding-left: ${({ theme }) => theme.spacing(1)}px; padding-bottom: ${({ theme }) => theme.spacing(1)}px; `; const StyledCardContent = styled(CardContent)` flex: 1 0 auto; `; const StyledCardMedia = styled(CardMedia)` width: 151px; `; const StyledButton = styled(Button)` margin: auto; `; const StyledIconButton = styled(IconButton)` position: absolute; right: 3px; top: 0; `; const UserProfile: FC = ({ handleClose, open, image, name, email, roles = [], }) => ( handleClose()} open={open}> {open && (
{name} {email} Roles: {roles.join(', ')} } onClick={() => handleClose(true)} > Log Out
handleClose()} edge="end" size="small">
)}
); export default UserProfile;