import { AlignLeft, CircleCheck, ClipboardList, LayoutDashboard, Plus, Settings, Users, type LucideIcon, } from 'lucide-react' export interface NavItem { label: string href: string icon: LucideIcon } const NAV_ITEMS: Record = { ssa: [ { label: 'Overview', href: '/ssa', icon: AlignLeft }, { label: 'My Reports', href: '/ssa/my-reports', icon: ClipboardList }, { label: 'Site Incidents', href: '/ssa/incidents', icon: ClipboardList }, { label: 'My CAPAs', href: '/ssa/capas', icon: CircleCheck }, { label: 'New Incident', href: '/report', icon: Plus }, ], hse: [ { label: 'Dashboard', href: '/hse/dashboard', icon: LayoutDashboard }, { label: 'Incidents', href: '/hse/incidents', icon: ClipboardList }, { label: 'CAPA', href: '/hse/capa', icon: CircleCheck }, { label: 'Settings', href: '/hse/settings', icon: Settings }, ], management: [{ label: 'Dashboard', href: '/management', icon: LayoutDashboard }], admin: [ { label: 'Admin', href: '/admin', icon: Users }, { label: 'Dashboard', href: '/hse/dashboard', icon: LayoutDashboard }, { label: 'Incidents', href: '/hse/incidents', icon: ClipboardList }, { label: 'CAPA', href: '/hse/capa', icon: CircleCheck }, { label: 'Management', href: '/management', icon: AlignLeft }, { label: 'Settings', href: '/hse/settings', icon: Settings }, ], } const EXACT_ROOTS = ['/ssa', '/management', '/admin', '/report', '/account'] export function navItemsFor(role: string): NavItem[] { return NAV_ITEMS[role] ?? NAV_ITEMS.ssa } export function isActivePath(href: string, pathname: string): boolean { return EXACT_ROOTS.includes(href) ? pathname === href : pathname.startsWith(href) } export function searchHrefFor(role: string): string | null { if (role === 'hse' || role === 'admin') return '/hse/incidents' if (role === 'ssa') return '/ssa/incidents' return null }