- Restore `as any` casts for Next.js typedRoutes on dynamic routes - Use proper types for PDF templates, invoice/expense data, DB schema - Fix PgColumn casts in sort helpers for expenses/invoices - Add null guards for optional port/client in record-export - Fix vitest config (remove invalid poolOptions) - Lint: 0 errors, TypeScript: 0 errors Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
47 lines
1.6 KiB
TypeScript
47 lines
1.6 KiB
TypeScript
'use client';
|
|
|
|
import Link from 'next/link';
|
|
import { usePathname } from 'next/navigation';
|
|
import { LayoutDashboard, Anchor, FileText, Receipt } from 'lucide-react';
|
|
import { cn } from '@/lib/utils';
|
|
|
|
const navItems = [
|
|
{ label: 'Dashboard', href: '/portal/dashboard', icon: LayoutDashboard },
|
|
{ label: 'Interests', href: '/portal/interests', icon: Anchor },
|
|
{ label: 'Documents', href: '/portal/documents', icon: FileText },
|
|
{ label: 'Invoices', href: '/portal/invoices', icon: Receipt },
|
|
];
|
|
|
|
export function PortalNav() {
|
|
const pathname = usePathname();
|
|
|
|
return (
|
|
<nav className="border-b bg-white">
|
|
<div className="max-w-5xl mx-auto px-4 sm:px-6">
|
|
<div className="flex gap-1 -mb-px overflow-x-auto">
|
|
{navItems.map((item) => {
|
|
const Icon = item.icon;
|
|
const isActive = pathname === item.href || pathname.startsWith(item.href + '/');
|
|
return (
|
|
<Link
|
|
key={item.href}
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
href={item.href as any}
|
|
className={cn(
|
|
'flex items-center gap-2 px-4 py-3 text-sm font-medium border-b-2 transition-colors whitespace-nowrap',
|
|
isActive
|
|
? 'border-[#1e2844] text-[#1e2844]'
|
|
: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300',
|
|
)}
|
|
>
|
|
<Icon className="h-4 w-4" />
|
|
{item.label}
|
|
</Link>
|
|
);
|
|
})}
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
);
|
|
}
|