From 9b0db9f8614225c79182fcbf098982f1efa6657c Mon Sep 17 00:00:00 2001 From: Junnian Liu Date: Mon, 11 May 2026 00:10:39 -0700 Subject: [PATCH] updated admin layout --- components/admin/AdminLayout.tsx | 133 ++++++++++++++++++++++++------- tsconfig.tsbuildinfo | 1 - 2 files changed, 106 insertions(+), 28 deletions(-) delete mode 100644 tsconfig.tsbuildinfo diff --git a/components/admin/AdminLayout.tsx b/components/admin/AdminLayout.tsx index 08b05e6..d1a3adb 100644 --- a/components/admin/AdminLayout.tsx +++ b/components/admin/AdminLayout.tsx @@ -3,11 +3,23 @@ import React from "react"; import Link from "next/link"; import { usePathname } from "next/navigation"; +import { useSession } from "next-auth/react"; +import { + LayoutDashboard, + FileText, + Calendar, + Settings, + TrendingUp, +} from "lucide-react"; -const navItems = [ - { label: "Dashboard", href: "/admin" }, - { label: "Applications", href: "/admin/applications" }, - { label: "Events", href: "/admin/events" }, +const mainNavItems = [ + { label: "Dashboard", href: "/admin", icon: LayoutDashboard }, + { label: "Applications", href: "/admin/applications", icon: FileText }, + { label: "Events", href: "/admin/events", icon: Calendar }, +]; + +const systemNavItems = [ + { label: "Settings", href: "/admin/settings", icon: Settings }, ]; export default function AdminLayout({ @@ -16,32 +28,99 @@ export default function AdminLayout({ children: React.ReactNode; }) { const pathname = usePathname(); + const { data: session } = useSession(); + + const isActive = (href: string) => + href === "/admin" ? pathname === "/admin" : pathname.startsWith(href); + + const userInitial = session?.user?.name?.[0]?.toUpperCase() ?? "?"; return (
-