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:
@@ -1,6 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import Link from 'next/link'
|
||||
import { StatusTag } from '@/components/ui/status-tag'
|
||||
|
||||
interface Props {
|
||||
incidentId: string
|
||||
@@ -12,15 +13,6 @@ interface Props {
|
||||
canAddCapa?: boolean
|
||||
}
|
||||
|
||||
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 STATUS_LABELS: Record<string, string> = {
|
||||
reported: 'Reported',
|
||||
triaged: 'Triaged',
|
||||
@@ -45,9 +37,7 @@ export function IncidentHeader({
|
||||
<span className="text-sm font-mono font-semibold text-gray-900 truncate">
|
||||
{referenceNo ?? 'Pending'}
|
||||
</span>
|
||||
<span className={`text-xs px-2 py-0.5 rounded-full font-medium shrink-0 ${STATUS_COLORS[status] ?? 'bg-gray-100 text-gray-800'}`}>
|
||||
{STATUS_LABELS[status] ?? status.replace(/_/g, ' ')}
|
||||
</span>
|
||||
<span className="shrink-0"><StatusTag status={status}>{STATUS_LABELS[status] ?? status.replace(/_/g, ' ')}</StatusTag></span>
|
||||
</div>
|
||||
<div className="flex gap-2 shrink-0">
|
||||
{canTriage && (
|
||||
|
||||
Reference in New Issue
Block a user