import { BarChart3, ClipboardCheck, ClipboardList, FileSpreadsheet, LayoutDashboard, MapPin, type LucideIcon } from 'lucide-react' import type { Role } from '../../shared/enums.ts' import type { Messages } from '../i18n/en' export interface NavItem { label: keyof Messages['nav'] to: string icon: LucideIcon /** Hidden from roles below this. */ minRole?: Role } export const primaryNav: NavItem[] = [ { label: 'overview', to: '/', icon: LayoutDashboard }, { label: 'incidents', to: '/incidents', icon: ClipboardList }, { label: 'myActions', to: '/actions', icon: ClipboardCheck }, { label: 'locations', to: '/locations', icon: MapPin }, { label: 'analytics', to: '/analytics', icon: BarChart3 }, { label: 'osha', to: '/osha', icon: FileSpreadsheet, minRole: 'safety_manager' }, ] export function pageTitle(pathname: string): string { if (/^\/osha\/cases\//.test(pathname)) return 'Form 301' const incident = /^\/incidents\/(\d+)/.exec(pathname) if (incident) return `INC-${incident[1].padStart(4, '0')}` const titles: Record = { '/': 'Overview', '/incidents': 'Incidents', '/actions': 'My actions', '/locations': 'Locations', '/analytics': 'Analytics', '/osha': 'OSHA log', '/report': 'Report an incident', '/locations/qr': 'QR codes', '/settings': 'Settings', '/about': 'About', } return titles[pathname] ?? 'Not found' }