blob: 6a3be3c8c152d2427bb9b2bee54b7e9f7f2a556c [file] [log] [blame]
simon26e79f72022-10-05 22:16:08 -04001/*
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éraudab519ff2022-05-03 15:34:48 -040018import { Box, Card, CardContent, Typography } from '@mui/material';
simon20076982022-10-11 15:04:13 -040019import { Account } from 'jami-web-common';
simon6b9ddfb2022-10-03 00:04:50 -040020
21type JamiIdCardProps = {
22 account: Account;
23};
24
25export default function JamiIdCard(props: JamiIdCardProps) {
simond47ef9e2022-09-28 22:24:28 -040026 const account = props.account;
27 const registeredName = account.getRegisteredName();
28 return (
29 <Card style={{ marginBottom: 16 }}>
Adrien Béraud150b4782021-04-21 19:40:59 -040030 <CardContent>
31 <Box>
simond47ef9e2022-09-28 22:24:28 -040032 <Typography color="textSecondary">Jami ID</Typography>
33 <Typography variant="h5" component="h2" gutterBottom noWrap>
34 {account.getUri()}
35 </Typography>
Adrien Béraud150b4782021-04-21 19:40:59 -040036 </Box>
simond47ef9e2022-09-28 22:24:28 -040037 {registeredName && (
38 <Box>
39 <Typography color="textSecondary">Jami username</Typography>
40 <Typography variant="h5" component="h2" noWrap>
41 {registeredName}
42 </Typography>
Adrien Béraud150b4782021-04-21 19:40:59 -040043 </Box>
simond47ef9e2022-09-28 22:24:28 -040044 )}
Adrien Béraud150b4782021-04-21 19:40:59 -040045 </CardContent>
46 </Card>
simond47ef9e2022-09-28 22:24:28 -040047 );
Adrien Béraud150b4782021-04-21 19:40:59 -040048}