mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-17 09:45:29 +00:00
29 lines
906 B
TypeScript
29 lines
906 B
TypeScript
import React, {useEffect, useState} from 'react'
|
|
import {Card, Flex, Skeleton, Typography} from 'antd'
|
|
import type { User} from '../utils/api'
|
|
import {getUser} from '../utils/api'
|
|
import {t} from 'ttag'
|
|
|
|
export default function UserPage() {
|
|
const [user, setUser] = useState<User | null>(null)
|
|
|
|
useEffect(() => {
|
|
getUser().then(setUser)
|
|
}, [])
|
|
|
|
return (
|
|
<Skeleton loading={user === null} active>
|
|
<Flex gap='middle' align='center' justify='center' vertical>
|
|
<Card title={t`My Account`}>
|
|
<Typography.Paragraph>
|
|
{t`Username`} : {user?.email}
|
|
</Typography.Paragraph>
|
|
<Typography.Paragraph>
|
|
{t`Roles`} : {user?.roles.join(',')}
|
|
</Typography.Paragraph>
|
|
</Card>
|
|
</Flex>
|
|
</Skeleton>
|
|
)
|
|
}
|