import { AlertTriangle, MapPin } from 'lucide-react' import { Link, useNavigate } from 'react-router-dom' import type { Incident } from '../../shared/api-types.ts' import { formatDate } from '../lib/dates' import { incidentTypeLabel, incidentTypeTone } from '../lib/labels' import { toneClasses } from '../lib/tones' import { SeverityLabel, StatusBadge } from './Badges' const th = 'border-b border-line px-2.5 py-3 font-mono text-3xs font-medium tracking-[0.06em] text-faint uppercase first:pl-6 last:pr-6' const td = 'border-b border-line-soft px-2.5 py-3.5 text-2xs whitespace-nowrap text-body first:pl-6 last:pr-6' export function IncidentTable({ incidents, wide = false }: { incidents: Incident[]; wide?: boolean }) { const navigate = useNavigate() return (
{incidents.map((incident) => ( navigate(`/incidents/${incident.number}`)} > ))}
Incident Type Severity Location Status Occurred
event.stopPropagation()} > {incident.title} {incident.reference} ยท {incident.anonymous ? 'Anonymous' : (incident.reporter?.name ?? incident.reporterName ?? 'Unknown')}
{incidentTypeLabel[incident.type]}
{incident.area?.name ?? incident.site.name} {incident.locationDetail || incident.site.name}
{formatDate(incident.occurredAt)}
) }