refactor(design): replace status, priority and severity color maps with StatusTag and mono tokens

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 19:08:18 +08:00
co-authored by Claude Haiku 4.5
parent 0b5020b3d0
commit ba9eeefe47
12 changed files with 45 additions and 125 deletions
+2 -12
View File
@@ -1,4 +1,5 @@
import { EvidenceGallery } from './evidence-gallery'
import { StatusTag } from '@/components/ui/status-tag'
const TYPE_LABELS: Record<string, string> = {
injury: 'Injury / Medical',
@@ -11,15 +12,6 @@ const TYPE_LABELS: Record<string, string> = {
transport: 'Transport / Vehicle',
}
const STATUS_COLORS: Record<string, string> = {
reported: 'bg-yellow-100 text-yellow-800',
triaged: 'bg-blue-100 text-blue-800',
investigating: 'bg-purple-100 text-purple-800',
capa_pending: 'bg-orange-100 text-orange-800',
verification: 'bg-indigo-100 text-indigo-800',
closed: 'bg-green-100 text-green-800',
}
const MEDICAL_LABELS: Record<string, string> = {
none: 'None',
first_aid: 'First Aid',
@@ -80,9 +72,7 @@ export function IncidentDetail({ incident }: Props) {
</h1>
<p className="text-sm text-gray-600 mt-0.5">{TYPE_LABELS[incident.incident_type] ?? incident.incident_type}</p>
</div>
<span className={`text-xs px-2.5 py-1 rounded-full font-medium ${STATUS_COLORS[incident.status] ?? 'bg-gray-100'}`}>
{incident.status.replace(/_/g, ' ').toUpperCase()}
</span>
<StatusTag status={incident.status}>{incident.status.replace(/_/g, ' ').toUpperCase()}</StatusTag>
</div>
<dl className="grid grid-cols-2 gap-4 sm:grid-cols-3">