Adrien Béraud | ab519ff | 2022-05-03 15:34:48 -0400 | [diff] [blame] | 1 | import { Box, Card, CardContent, Typography } from '@mui/material'; |
Adrien Béraud | 6ecaa40 | 2021-04-06 17:37:25 -0400 | [diff] [blame] | 2 | |
simon | 6b9ddfb | 2022-10-03 00:04:50 -0400 | [diff] [blame] | 3 | import Account from '../../../model/Account'; |
| 4 | |
| 5 | type JamiIdCardProps = { |
| 6 | account: Account; |
| 7 | }; |
| 8 | |
| 9 | export default function JamiIdCard(props: JamiIdCardProps) { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 10 | const account = props.account; |
| 11 | const registeredName = account.getRegisteredName(); |
| 12 | return ( |
| 13 | <Card style={{ marginBottom: 16 }}> |
Adrien Béraud | 150b478 | 2021-04-21 19:40:59 -0400 | [diff] [blame] | 14 | <CardContent> |
| 15 | <Box> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 16 | <Typography color="textSecondary">Jami ID</Typography> |
| 17 | <Typography variant="h5" component="h2" gutterBottom noWrap> |
| 18 | {account.getUri()} |
| 19 | </Typography> |
Adrien Béraud | 150b478 | 2021-04-21 19:40:59 -0400 | [diff] [blame] | 20 | </Box> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 21 | {registeredName && ( |
| 22 | <Box> |
| 23 | <Typography color="textSecondary">Jami username</Typography> |
| 24 | <Typography variant="h5" component="h2" noWrap> |
| 25 | {registeredName} |
| 26 | </Typography> |
Adrien Béraud | 150b478 | 2021-04-21 19:40:59 -0400 | [diff] [blame] | 27 | </Box> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 28 | )} |
Adrien Béraud | 150b478 | 2021-04-21 19:40:59 -0400 | [diff] [blame] | 29 | </CardContent> |
| 30 | </Card> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 31 | ); |
Adrien Béraud | 150b478 | 2021-04-21 19:40:59 -0400 | [diff] [blame] | 32 | } |