| 1 | 'use client' |
| 2 | |
| 3 | import { |
| 4 | Briefcase, |
| 5 | ClipboardList, |
| 6 | Clock, |
| 7 | FileSpreadsheet, |
| 8 | FileText, |
| 9 | Folder, |
| 10 | LayoutDashboard, |
| 11 | Milestone, |
| 12 | Receipt, |
| 13 | Settings, |
| 14 | Users, |
| 15 | } from 'lucide-react' |
| 16 | import Link from 'next/link |
| 17 | import { usePathname } |
| 18 | import { cn } |
| 19 | import type { RouteImpl |
| 20 | |
| 21 | const iconMap: Record |
| 22 | Overview: LayoutDashboard, |
| 23 | Requirements: ClipboardList, |
| 24 | Proposals: FileText, |
| 25 | Milestones: Milestone, |
| 26 | Timesheets: Clock, |
| 27 | Expenses: Receipt, |
| 28 | Invoices: FileSpreadsheet, |
| 29 | Team: Users, |
| 30 | Settings, |
| 31 | Projects: Folder, |
| 32 | Teams: Users, |
| 33 | Clients: Briefcase, |
| 34 | } |
| 35 | |
| 36 | export default function OrgNavClient |
| 37 | tab, |
| 38 | slug, |
| 39 | }: { |
| 40 | tab: { |
| 41 | name: string |
| 42 | href: string |
| 43 | visible: boolean |
| 44 | } |
| 45 | slug: string |
| 46 | }) { |
| 47 | const pathname = |
| 48 | const Icon = |
| 49 | return ( |
| 50 | <Link |
| 51 | className={cn( |
| 52 | 'flex items-center gap-1.5 border-b-2 px-3 py-2 font-medium text-sm transition-colors', |
| 53 | pathname === tab. |
| 54 | (`/${slug}` |
| 55 | ? 'border-primary text-primary' |
| 56 | : 'border-transparent text-muted-foreground hover:border-muted-foreground hover:text-foreground' |
| 57 | )} |
| 58 | href={tab.href |
| 59 | key={tab.name |
| 60 | > |
| 61 | {Icon && <Icon |
| 62 | {tab.name} |
| 63 | </Link> |
| 64 | ) |
| 65 | } |