'use client' import Link from 'next/link' import { usePathname, useRouter } from 'next/navigation' import { useState } from 'react' import { LayoutDashboard, Users, FileText, TrendingUp, ShieldCheck, LogOut, Menu, X, } from 'lucide-react' interface AdminShellProps { admin: { id: string; email: string; name: string } children: React.ReactNode } const NAV = [ { href: '/pitch-admin', label: 'Dashboard', icon: LayoutDashboard, exact: true }, { href: '/pitch-admin/investors', label: 'Investors', icon: Users }, { href: '/pitch-admin/audit', label: 'Audit Log', icon: FileText }, { href: '/pitch-admin/financial-model', label: 'Financial Model', icon: TrendingUp }, { href: '/pitch-admin/admins', label: 'Admins', icon: ShieldCheck }, ] export default function AdminShell({ admin, children }: AdminShellProps) { const pathname = usePathname() const router = useRouter() const [open, setOpen] = useState(false) async function logout() { await fetch('/api/admin-auth/logout', { method: 'POST' }) router.push('/pitch-admin/login') } function isActive(item: typeof NAV[number]) { if (item.exact) return pathname === item.href return pathname === item.href || pathname.startsWith(item.href + '/') } return (