"use client" import Link from "next/link" import { usePathname } from "next/navigation" import { useSession } from "@/lib/auth-client" import { UsersIcon, CpuIcon, Gamepad2Icon, HardDriveIcon, MessageSquareIcon, MessageSquarePlusIcon, FlagIcon, BarChart3Icon, LayoutDashboardIcon, } from "lucide-react" type NavItem = | { type: "section"; label: string } | { type: "divider" } | { type: "link"; href: string; label: string; icon: React.ElementType; adminOnly?: boolean } const navItems: NavItem[] = [ { type: "section", label: "Overview" }, { type: "link", href: "/manage", label: "Dashboard", icon: LayoutDashboardIcon, }, { type: "link", href: "/manage/analytics", label: "Analytics", icon: BarChart3Icon, }, { type: "divider" }, { type: "section", label: "Management" }, { type: "link", href: "/manage/users", label: "Users", icon: UsersIcon, adminOnly: true }, { type: "link", href: "/manage/hardware", label: "Hardware", icon: CpuIcon, }, { type: "link", href: "/manage/storage", label: "Storage", icon: HardDriveIcon, adminOnly: true, }, { type: "link", href: "/manage/games", label: "Games", icon: Gamepad2Icon }, { type: "divider" }, { type: "section", label: "Moderation" }, { type: "link", href: "/manage/reports", label: "Reports", icon: FlagIcon }, { type: "link", href: "/manage/suggestions", label: "Suggestions", icon: MessageSquarePlusIcon, }, { type: "link", href: "/manage/benchmarks", label: "Benchmarks", icon: BarChart3Icon, }, { type: "link", href: "/manage/comments", label: "Comments", icon: MessageSquareIcon, }, ] export function ManageSidebar() { const pathname = usePathname() const { data: session } = useSession() const role = session?.user?.role ?? "user" const isAdmin = role === "admin" return ( ) }