feat: reporter clickable rows, CAPA owner action buttons, triage segmented severity
This commit is contained in:
@@ -4,6 +4,7 @@ import Link from 'next/link'
|
||||
import { createClient } from '@/lib/supabase/server'
|
||||
import { redirect } from 'next/navigation'
|
||||
import { StatCard } from '@/components/dashboard/stat-card'
|
||||
import { CapaOwnerActions } from '@/components/capa/capa-owner-actions'
|
||||
|
||||
const STATUS_LABELS: Record<string, string> = {
|
||||
open: 'Open',
|
||||
@@ -78,21 +79,24 @@ export default async function CapaOwnerPage() {
|
||||
<div className="flex-1 min-w-0">
|
||||
<p className="text-sm text-gray-800">{capa.description}</p>
|
||||
{incRef && (
|
||||
<p className="text-xs text-gray-500 mt-0.5">{incRef}</p>
|
||||
<Link href={`/hse/incidents/${capa.incident_id}`} className="text-xs text-blue-600 hover:underline mt-0.5 inline-block">
|
||||
{incRef}
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
<div className="shrink-0 text-right">
|
||||
<div className="shrink-0 text-right space-y-1">
|
||||
<span className={`text-xs rounded-full px-2 py-0.5 ${STATUS_COLORS[capa.status] ?? 'bg-gray-100 text-gray-600'}`}>
|
||||
{STATUS_LABELS[capa.status] ?? capa.status}
|
||||
</span>
|
||||
<p className={`text-xs mt-1 ${isOverdue ? 'text-red-600 font-semibold' : 'text-gray-400'}`}>
|
||||
<p className={`text-xs ${isOverdue ? 'text-red-600 font-semibold' : 'text-gray-400'}`}>
|
||||
{capa.due_date ? `Due ${new Date(capa.due_date as string).toLocaleDateString('en-MY')}` : 'No due date'}
|
||||
</p>
|
||||
{capa.priority && (
|
||||
<p className={`text-xs mt-0.5 ${PRIORITY_COLORS[capa.priority as string] ?? ''}`}>
|
||||
<p className={`text-xs ${PRIORITY_COLORS[capa.priority as string] ?? ''}`}>
|
||||
{(capa.priority as string).toUpperCase()} priority
|
||||
</p>
|
||||
)}
|
||||
<CapaOwnerActions capaId={capa.id} currentStatus={capa.status} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user