2024-12-30 23:50:15 +01:00
|
|
|
import React, {useEffect, useState} from 'react'
|
|
|
|
|
import {Card, Flex, Skeleton, Typography} from 'antd'
|
2024-12-31 13:55:42 +01:00
|
|
|
import type { User} from '../utils/api'
|
|
|
|
|
import {getUser} from '../utils/api'
|
2024-07-29 00:04:45 +02:00
|
|
|
import {t} from 'ttag'
|
2024-07-26 23:55:12 +02:00
|
|
|
|
|
|
|
|
export default function UserPage() {
|
2024-07-27 17:02:21 +02:00
|
|
|
const [user, setUser] = useState<User | null>(null)
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
getUser().then(setUser)
|
|
|
|
|
}, [])
|
|
|
|
|
|
2024-12-30 23:50:15 +01:00
|
|
|
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>
|
|
|
|
|
)
|
|
|
|
|
}
|