forked from purpleio/purple-admin-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.tsx
More file actions
42 lines (33 loc) ยท 1.15 KB
/
index.tsx
File metadata and controls
42 lines (33 loc) ยท 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { useDashboard } from "@/client/sample/dashboard";
import { getDefaultLayout, IDefaultLayoutPage, IPageHeader } from "@/components/layout/default-layout";
import CalendarSample from "@/components/page/index/calendar-sample";
import StatisticSample from "@/components/page/index/statistic-sample";
import { useAuth } from "@/lib/auth/auth-provider";
import { Alert, Divider, Skeleton } from "antd";
const pageHeader: IPageHeader = {
title: "Welcome",
};
const IndexPage: IDefaultLayoutPage = () => {
const { session } = useAuth();
const { data, error } = useDashboard();
return (
<>
<h2 className="title">๐ {session.user.name || "๊ด๋ฆฌ์"}๋ ์๋
ํ์ธ์!</h2>
<div className="my-5">
{data ? (
<StatisticSample data={data} />
) : error ? (
<Alert message="๋์๋ณด๋ API ํธ์ถ ์ค ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค." type="warning" />
) : (
<Skeleton />
)}
</div>
<Divider />
<h3 className="title">๋ฌ๋ ฅ</h3>
<CalendarSample />
</>
);
};
IndexPage.getLayout = getDefaultLayout;
IndexPage.pageHeader = pageHeader;
export default IndexPage;