simon | 26e79f7 | 2022-10-05 22:16:08 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2022 Savoir-faire Linux Inc. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU Affero General Public License as |
| 6 | * published by the Free Software Foundation; either version 3 of the |
| 7 | * License, or (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU Affero General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Affero General Public |
| 15 | * License along with this program. If not, see |
| 16 | * <https://www.gnu.org/licenses/>. |
| 17 | */ |
Adrien Béraud | ab519ff | 2022-05-03 15:34:48 -0400 | [diff] [blame] | 18 | import { Box, Card, CardContent, Typography } from '@mui/material'; |
Misha Krieger-Raynauld | 6bbdacf | 2022-11-29 21:45:40 -0500 | [diff] [blame] | 19 | |
Misha Krieger-Raynauld | cfa4430 | 2022-11-30 18:36:36 -0500 | [diff] [blame] | 20 | import { Account } from '../models/account'; |
simon | 6b9ddfb | 2022-10-03 00:04:50 -0400 | [diff] [blame] | 21 | |
| 22 | type JamiIdCardProps = { |
| 23 | account: Account; |
| 24 | }; |
| 25 | |
| 26 | export default function JamiIdCard(props: JamiIdCardProps) { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 27 | const account = props.account; |
| 28 | const registeredName = account.getRegisteredName(); |
| 29 | return ( |
| 30 | <Card style={{ marginBottom: 16 }}> |
Adrien Béraud | 150b478 | 2021-04-21 19:40:59 -0400 | [diff] [blame] | 31 | <CardContent> |
| 32 | <Box> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 33 | <Typography color="textSecondary">Jami ID</Typography> |
| 34 | <Typography variant="h5" component="h2" gutterBottom noWrap> |
| 35 | {account.getUri()} |
| 36 | </Typography> |
Adrien Béraud | 150b478 | 2021-04-21 19:40:59 -0400 | [diff] [blame] | 37 | </Box> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 38 | {registeredName && ( |
| 39 | <Box> |
| 40 | <Typography color="textSecondary">Jami username</Typography> |
| 41 | <Typography variant="h5" component="h2" noWrap> |
| 42 | {registeredName} |
| 43 | </Typography> |
Adrien Béraud | 150b478 | 2021-04-21 19:40:59 -0400 | [diff] [blame] | 44 | </Box> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 45 | )} |
Adrien Béraud | 150b478 | 2021-04-21 19:40:59 -0400 | [diff] [blame] | 46 | </CardContent> |
| 47 | </Card> |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 48 | ); |
Adrien Béraud | 150b478 | 2021-04-21 19:40:59 -0400 | [diff] [blame] | 49 | } |