mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-18 02:05:36 +00:00
25 lines
782 B
TypeScript
25 lines
782 B
TypeScript
import React, {useEffect, useState} from "react";
|
|
import {Card, Flex, Skeleton, Typography} from "antd";
|
|
import {getUser, User} from "../../utils/api";
|
|
|
|
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="My Account">
|
|
<Typography.Paragraph>
|
|
Username : {user?.email}
|
|
</Typography.Paragraph>
|
|
<Typography.Paragraph>
|
|
Roles : {user?.roles.join(',')}
|
|
</Typography.Paragraph>
|
|
</Card>
|
|
</Flex>
|
|
</Skeleton>
|
|
} |