|
1 | 1 | import { Card, CardContent, CardHeader } from "@/components/ui/card"; |
2 | 2 | import { Skeleton } from "@/components/ui/skeleton/skeleton"; |
| 3 | +import PageContainer from "../_components/PageContainer"; |
3 | 4 |
|
4 | 5 | export default function AdminDashboardLoading() { |
5 | 6 | return ( |
6 | | - <div className="mx-auto max-w-screen-2xl space-y-6 p-6"> |
7 | | - <div className="flex items-center justify-between"> |
8 | | - <Skeleton className="h-8 w-32" /> |
9 | | - </div> |
| 7 | + <PageContainer maxWidth="2xl"> |
| 8 | + <div className="space-y-6"> |
| 9 | + <div className="flex items-center justify-between"> |
| 10 | + <div className="flex items-center gap-3"> |
| 11 | + <Skeleton className="h-12 w-12 rounded-full" /> |
| 12 | + <div> |
| 13 | + <Skeleton className="h-8 w-32" /> |
| 14 | + <Skeleton className="mt-2 h-4 w-64" /> |
| 15 | + </div> |
| 16 | + </div> |
| 17 | + </div> |
10 | 18 |
|
11 | | - {/* Metrics Grid Skeleton */} |
12 | | - <div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6"> |
13 | | - {Array.from({ length: 6 }).map((_, i) => ( |
14 | | - <Card key={i} className="group"> |
15 | | - <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2"> |
16 | | - <div className="space-y-1"> |
| 19 | + {/* Metrics Grid Skeleton */} |
| 20 | + <div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6"> |
| 21 | + {Array.from({ length: 6 }).map((_, i) => ( |
| 22 | + <Card key={i}> |
| 23 | + <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2"> |
17 | 24 | <Skeleton className="h-4 w-24" /> |
18 | | - </div> |
19 | | - <div className="rounded-lg bg-muted p-2"> |
20 | | - <Skeleton className="h-4 w-4 rounded" /> |
21 | | - </div> |
22 | | - </CardHeader> |
23 | | - <CardContent> |
24 | | - <Skeleton className="h-8 w-16" /> |
25 | | - <Skeleton className="mt-1 h-3 w-20" /> |
26 | | - </CardContent> |
27 | | - </Card> |
28 | | - ))} |
29 | | - </div> |
| 25 | + <Skeleton className="h-5 w-5 rounded" /> |
| 26 | + </CardHeader> |
| 27 | + <CardContent> |
| 28 | + <Skeleton className="h-8 w-16" /> |
| 29 | + <Skeleton className="mt-1 h-3 w-20" /> |
| 30 | + </CardContent> |
| 31 | + </Card> |
| 32 | + ))} |
| 33 | + </div> |
30 | 34 |
|
31 | | - {/* Charts Section Skeleton */} |
32 | | - <div className="grid grid-cols-1 gap-6 lg:grid-cols-2"> |
33 | | - {Array.from({ length: 2 }).map((_, i) => ( |
34 | | - <Card key={i}> |
35 | | - <CardHeader className="items-center pb-0"> |
36 | | - <Skeleton className="h-6 w-32" /> |
37 | | - <Skeleton className="h-4 w-48" /> |
38 | | - </CardHeader> |
39 | | - <CardContent className="flex-1 pb-0"> |
40 | | - <div className="mx-auto flex aspect-square max-h-[350px] items-center justify-center"> |
41 | | - <Skeleton className="h-64 w-64 rounded-full" /> |
42 | | - </div> |
43 | | - <div className="mt-4 flex flex-wrap justify-center gap-2"> |
44 | | - {Array.from({ length: 4 }).map((_, j) => ( |
45 | | - <Skeleton key={j} className="h-4 w-16" /> |
46 | | - ))} |
47 | | - </div> |
48 | | - </CardContent> |
49 | | - </Card> |
50 | | - ))} |
51 | | - </div> |
| 35 | + {/* Charts Section Skeleton */} |
| 36 | + <div className="grid grid-cols-1 gap-6 lg:grid-cols-2"> |
| 37 | + {Array.from({ length: 2 }).map((_, i) => ( |
| 38 | + <Card key={i}> |
| 39 | + <CardHeader className="items-center pb-0"> |
| 40 | + <Skeleton className="h-6 w-32" /> |
| 41 | + <Skeleton className="h-4 w-48" /> |
| 42 | + </CardHeader> |
| 43 | + <CardContent className="flex-1 pb-0"> |
| 44 | + <div className="mx-auto flex aspect-square max-h-[350px] items-center justify-center"> |
| 45 | + <Skeleton className="h-64 w-64 rounded-full" /> |
| 46 | + </div> |
| 47 | + <div className="mt-4 flex flex-wrap justify-center gap-2"> |
| 48 | + {Array.from({ length: 4 }).map((_, j) => ( |
| 49 | + <Skeleton key={j} className="h-4 w-16" /> |
| 50 | + ))} |
| 51 | + </div> |
| 52 | + </CardContent> |
| 53 | + </Card> |
| 54 | + ))} |
| 55 | + </div> |
52 | 56 |
|
53 | | - {/* Line Chart Skeleton */} |
54 | | - <Card> |
55 | | - <CardHeader> |
56 | | - <Skeleton className="h-6 w-40" /> |
57 | | - <Skeleton className="h-4 w-64" /> |
58 | | - </CardHeader> |
59 | | - <CardContent className="h-80"> |
60 | | - <div className="flex h-full items-end justify-between space-x-2"> |
61 | | - {Array.from({ length: 6 }).map((_, i) => ( |
62 | | - <Skeleton |
63 | | - key={i} |
64 | | - className="w-full" |
65 | | - style={{ height: `${Math.random() * 80 + 20}%` }} |
66 | | - /> |
67 | | - ))} |
68 | | - </div> |
69 | | - </CardContent> |
70 | | - <CardContent> |
71 | | - <Skeleton className="h-4 w-80" /> |
72 | | - </CardContent> |
73 | | - </Card> |
74 | | - </div> |
| 57 | + {/* Line Chart Skeleton */} |
| 58 | + <Card> |
| 59 | + <CardHeader> |
| 60 | + <Skeleton className="h-6 w-40" /> |
| 61 | + <Skeleton className="h-4 w-64" /> |
| 62 | + </CardHeader> |
| 63 | + <CardContent className="h-80"> |
| 64 | + <div className="flex h-full items-end justify-between space-x-2"> |
| 65 | + {Array.from({ length: 6 }).map((_, i) => ( |
| 66 | + <Skeleton |
| 67 | + key={i} |
| 68 | + className="w-full" |
| 69 | + style={{ height: `${Math.random() * 80 + 20}%` }} |
| 70 | + /> |
| 71 | + ))} |
| 72 | + </div> |
| 73 | + </CardContent> |
| 74 | + <CardContent> |
| 75 | + <Skeleton className="h-4 w-80" /> |
| 76 | + </CardContent> |
| 77 | + </Card> |
| 78 | + </div> |
| 79 | + </PageContainer> |
75 | 80 | ); |
76 | 81 | } |
0 commit comments