blob: bfa804593ee41cb8dd36e00ac0176459c8f09283 [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';
Misha Krieger-Raynauld6bbdacf2022-11-29 21:45:40 -050019
Misha Krieger-Raynauldcfa44302022-11-30 18:36:36 -050020import { Account } from '../models/account';
simon6b9ddfb2022-10-03 00:04:50 -040021
22type JamiIdCardProps = {
23 account: Account;
24};
25
26export default function JamiIdCard(props: JamiIdCardProps) {
simond47ef9e2022-09-28 22:24:28 -040027 const account = props.account;
28 const registeredName = account.getRegisteredName();
29 return (
30 <Card style={{ marginBottom: 16 }}>
Adrien Béraud150b4782021-04-21 19:40:59 -040031 <CardContent>
32 <Box>
simond47ef9e2022-09-28 22:24:28 -040033 <Typography color="textSecondary">Jami ID</Typography>
34 <Typography variant="h5" component="h2" gutterBottom noWrap>
35 {account.getUri()}
36 </Typography>
Adrien Béraud150b4782021-04-21 19:40:59 -040037 </Box>
simond47ef9e2022-09-28 22:24:28 -040038 {registeredName && (
39 <Box>
40 <Typography color="textSecondary">Jami username</Typography>
41 <Typography variant="h5" component="h2" noWrap>
42 {registeredName}
43 </Typography>
Adrien Béraud150b4782021-04-21 19:40:59 -040044 </Box>
simond47ef9e2022-09-28 22:24:28 -040045 )}
Adrien Béraud150b4782021-04-21 19:40:59 -040046 </CardContent>
47 </Card>
simond47ef9e2022-09-28 22:24:28 -040048 );
Adrien Béraud150b4782021-04-21 19:40:59 -040049}