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 (
| Incident | Type | Severity | Location | Status | Occurred |
|---|---|---|---|---|---|
|
event.stopPropagation()}
>
{incident.title}
{incident.reference} ยท {incident.anonymous ? 'Anonymous' : (incident.reporter?.name ?? incident.reporterName ?? 'Unknown')}
|
{incidentTypeLabel[incident.type]} |
|
|
|
{formatDate(incident.occurredAt)} |