@@ -6,38 +6,46 @@ import { Calendar1, User } from "lucide-react";
66import { Separator } from "@/components/ui/Separator" ;
77import { Link } from "@/lib/navigation" ;
88import { useAuthUser } from "@/components/hooks/UseAuthUser" ;
9+ import ProtectedRoute from "@/components/layout/ProtectedRoute" ;
910
10- export default function UserLayout ( { children } : { children : React . ReactNode } ) {
11+ interface UserLayoutProps {
12+ children : React . ReactNode ;
13+ }
14+
15+ export default function UserLayout ( { children } : UserLayoutProps ) {
1116 const { user } = useAuthUser ( ) ;
17+
1218 return (
13- < section className = "container mx-auto px-5 pt-24 pb-28" >
14- < div className = "grid grid-cols-5 gap-8" >
15- < aside className = "fixed right-0 bottom-0 left-0 col-span-1 mt-8 flex w-full flex-col justify-between gap-4 self-start rounded-lg bg-white lg:sticky lg:top-24 lg:flex-col lg:justify-start lg:bg-transparent dark:bg-slate-950" >
16- < div className = "flex items-center gap-4" >
17- < Avatar className = "h-12 w-12" >
18- < AvatarImage src = "" />
19- < AvatarFallback > US</ AvatarFallback >
20- </ Avatar >
21- < div >
22- < p className = "text-muted-foreground text-sm" > Hello</ p >
23- < p className = "font-semibold" > { user ?. username } </ p >
19+ < ProtectedRoute >
20+ < section className = "container mx-auto px-5 pt-24 pb-28" >
21+ < div className = "grid grid-cols-5 gap-8" >
22+ < aside className = "fixed right-0 bottom-0 left-0 col-span-1 mt-8 flex w-full flex-col justify-between gap-4 self-start rounded-lg bg-white lg:sticky lg:top-24 lg:flex-col lg:justify-start lg:bg-transparent dark:bg-slate-950" >
23+ < div className = "flex items-center gap-4" >
24+ < Avatar className = "h-12 w-12" >
25+ < AvatarImage src = "" alt = "profile" />
26+ < AvatarFallback > US</ AvatarFallback >
27+ </ Avatar >
28+ < div >
29+ < p className = "text-muted-foreground text-sm" > Hello</ p >
30+ < p className = "font-semibold" > { user ?. username } </ p >
31+ </ div >
2432 </ div >
25- </ div >
26-
27- < Separator />
28-
29- < nav className = "flex flex-col gap-3 text-sm " >
30- < Link href = "/my-events" className = "flex items-center gap-2 text-gray-800 transition hover:text-blue-600" >
31- < Calendar1 size = { 16 } /> My Events
32- </ Link >
33- < Link href = "/profile" className = "flex items-center gap-2 text-gray-800 transition hover:text-blue-600" >
34- < User size = { 16 } /> Profil
35- </ Link >
36- </ nav >
37- </ aside >
38-
39- < div className = "col-span-4" > { children } < /div >
40- </ div >
41- </ section >
33+
34+ < Separator />
35+
36+ < nav className = "flex flex-col gap-3 text-sm" >
37+ < Link href = "/my-events" className = "flex items-center gap-2 text-gray-800 transition hover:text-blue-600 " >
38+ < Calendar1 size = { 16 } /> My Events
39+ </ Link >
40+ < Link href = "/profile" className = "flex items-center gap-2 text-gray-800 transition hover:text-blue-600" >
41+ < User size = { 16 } /> Profil
42+ </ Link >
43+ </ nav >
44+ </ aside >
45+
46+ < div className = "col-span-4" > { children } </ div >
47+ </ div >
48+ </ section >
49+ </ ProtectedRoute >
4250 ) ;
4351}
0 commit comments