@@ -6,6 +6,11 @@ import { useRouter } from "next/navigation"
66import AdminSidebar from "@/components/admin-sidebar"
77import { useAuth } from "@/lib/auth-context"
88
9+ import { Skeleton } from "@/components/ui/skeleton"
10+ import { Button } from "@/components/ui/button"
11+ import { Card , CardContent , CardDescription , CardHeader , CardTitle } from "@/components/ui/card"
12+ import { Lock } from "lucide-react"
13+
914export default function AdminLayout ( {
1015 children,
1116} : {
@@ -24,16 +29,52 @@ export default function AdminLayout({
2429
2530 if ( isLoading ) {
2631 return (
27- < div className = "flex items-center justify-center h-screen text-white" >
28- < p > Loading...</ p >
32+ < div className = "flex h-screen w-full bg-background" >
33+ { /* Sidebar Skeleton */ }
34+ < div className = "hidden w-60 border-r md:block p-4 space-y-4" >
35+ < Skeleton className = "h-8 w-32" />
36+ < div className = "space-y-2 mt-8" >
37+ < Skeleton className = "h-10 w-full" />
38+ < Skeleton className = "h-10 w-full" />
39+ < Skeleton className = "h-10 w-full" />
40+ < Skeleton className = "h-10 w-full" />
41+ </ div >
42+ </ div >
43+ { /* Content Skeleton */ }
44+ < div className = "flex-1 p-8 space-y-4" >
45+ < Skeleton className = "h-8 w-48 mb-8" />
46+ < div className = "grid gap-4 md:grid-cols-2 lg:grid-cols-3" >
47+ < Skeleton className = "h-32 rounded-xl" />
48+ < Skeleton className = "h-32 rounded-xl" />
49+ < Skeleton className = "h-32 rounded-xl" />
50+ </ div >
51+ < Skeleton className = "h-96 w-full rounded-xl mt-8" />
52+ </ div >
2953 </ div >
3054 )
3155 }
3256
3357 if ( ! user || ! [ "super" , "admin" , "manager" ] . includes ( userRole || "" ) ) {
3458 return (
35- < div className = "flex items-center justify-center h-screen text-white" >
36- < p > Access Denied</ p >
59+ < div className = "flex h-screen w-full items-center justify-center bg-background p-4" >
60+ < Card className = "w-full max-w-md" >
61+ < CardHeader className = "text-center" >
62+ < div className = "flex justify-center mb-4" >
63+ < div className = "p-3 rounded-full bg-destructive/10" >
64+ < Lock className = "h-6 w-6 text-destructive" />
65+ </ div >
66+ </ div >
67+ < CardTitle > Access Denied</ CardTitle >
68+ < CardDescription >
69+ You do not have permission to access the admin area.
70+ </ CardDescription >
71+ </ CardHeader >
72+ < CardContent className = "flex justify-center" >
73+ < Button variant = "outline" onClick = { ( ) => router . replace ( "/" ) } >
74+ Return to Home
75+ </ Button >
76+ </ CardContent >
77+ </ Card >
3778 </ div >
3879 )
3980 }
0 commit comments