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:
@@ -8,6 +8,7 @@ import { incidents, sites, capaActions, users } from '@/lib/db/schema'
|
||||
import { eq, not, and, inArray, sql, desc } from 'drizzle-orm'
|
||||
import { aliasedTable } from 'drizzle-orm'
|
||||
import { StatCard } from '@/components/dashboard/stat-card'
|
||||
import { StatusTag } from '@/components/ui/status-tag'
|
||||
|
||||
const STATUS_LABELS: Record<string, string> = {
|
||||
reported: 'Reported',
|
||||
@@ -18,15 +19,6 @@ const STATUS_LABELS: Record<string, string> = {
|
||||
closed: 'Closed',
|
||||
}
|
||||
|
||||
const STATUS_COLORS: Record<string, string> = {
|
||||
reported: 'bg-gray-100 text-gray-700',
|
||||
triaged: 'bg-yellow-100 text-yellow-800',
|
||||
investigating: 'bg-blue-100 text-blue-700',
|
||||
capa_pending: 'bg-orange-100 text-orange-700',
|
||||
verification: 'bg-purple-100 text-purple-700',
|
||||
closed: 'bg-green-100 text-green-700',
|
||||
}
|
||||
|
||||
export default async function SupervisorPage() {
|
||||
const session = await getSession()
|
||||
if (!session) redirect('/login')
|
||||
@@ -149,9 +141,7 @@ export default async function SupervisorPage() {
|
||||
<p className="text-sm font-medium text-gray-900">{inc.referenceNo ?? inc.id.slice(0, 8)}</p>
|
||||
<p className="text-xs text-gray-500">{TYPE_LABELS[inc.incidentType] ?? inc.incidentType}</p>
|
||||
</div>
|
||||
<span className={`text-xs rounded-full px-2 py-0.5 font-medium ${STATUS_COLORS[inc.status] ?? 'bg-gray-100 text-gray-700'}`}>
|
||||
{STATUS_LABELS[inc.status] ?? inc.status}
|
||||
</span>
|
||||
<StatusTag status={inc.status}>{STATUS_LABELS[inc.status] ?? inc.status}</StatusTag>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user