"use client"; import Link from "next/link"; import { usePathname, useRouter } from "next/navigation"; import { cn } from "@/lib/utils"; import { LayoutGrid, Cable, Key, Users, Settings, DollarSign, LogOut, } from "lucide-react"; import { Separator } from "@/components/ui/separator"; import { signOut } from "@/lib/firebase/auth"; import { toast } from "sonner"; interface WorkspaceLeftRailProps { activeSection?: string; onSectionChange: (section: string) => void; } const navItems = [ { id: 'projects', label: 'Projects', icon: LayoutGrid, href: '/projects', }, { id: 'connections', label: 'Connect', icon: Cable, href: '/connections', }, { id: 'keys', label: 'Keys', icon: Key, href: '/keys', }, { id: 'costs', label: 'Costs', icon: DollarSign, href: '/costs', }, { id: 'users', label: 'Users', icon: Users, href: '/users', }, ]; export function WorkspaceLeftRail({ activeSection = 'projects', onSectionChange }: WorkspaceLeftRailProps) { const pathname = usePathname(); const router = useRouter(); // Extract workspace from pathname (e.g., /marks-account/projects -> marks-account) const workspace = pathname?.split('/')[1] || 'marks-account'; const handleSignOut = async () => { try { await signOut(); toast.success("Signed out successfully"); router.push("/auth"); } catch (error: any) { toast.error(error.message); } }; return (