"use client" import Link from "next/link" import { usePathname, useRouter } from "next/navigation" import { BrainCircuit, LayoutDashboard, Zap, ListOrdered, LogOut, Settings, Library, HardDrive, ChevronRight, } from "lucide-react" import { cn } from "@/lib/utils" import { createClient } from "@/lib/supabase/client" const navItems = [ { href: "/dashboard", label: "Dashboard", icon: LayoutDashboard, activeColor: "text-indigo-400", iconBg: "bg-indigo-500/15", glow: "rgba(99,102,241,0.35)" }, { href: "/train", label: "Train", icon: Zap, activeColor: "text-violet-400", iconBg: "bg-violet-500/15", glow: "rgba(139,92,246,0.35)" }, { href: "/models", label: "Model Catalog", icon: Library, activeColor: "text-cyan-400", iconBg: "bg-cyan-500/15", glow: "rgba(6,182,212,0.35)" }, { href: "/datasets", label: "Datasets", icon: HardDrive, activeColor: "text-emerald-400", iconBg: "bg-emerald-500/15", glow: "rgba(16,185,129,0.35)" }, { href: "/runs", label: "All Runs", icon: ListOrdered, activeColor: "text-amber-400", iconBg: "bg-amber-500/15", glow: "rgba(245,158,11,0.35)" }, ] interface SidebarProps { userEmail?: string } export function Sidebar({ userEmail }: SidebarProps) { const pathname = usePathname() const router = useRouter() const supabase = createClient() async function signOut() { await supabase.auth.signOut() router.push("/auth/login") router.refresh() } const initials = userEmail ? userEmail[0].toUpperCase() : "M" const handle = userEmail?.split("@")[0] ?? "user" return ( ) }