'use client' import Link from 'next/link' import { StatusTag } from '@/components/ui/status-tag' interface Props { incidentId: string referenceNo: string | null status: string backHref: string canTriage?: boolean canInvestigate?: boolean canAddCapa?: boolean } const STATUS_LABELS: Record = { reported: 'Reported', triaged: 'Triaged', investigating: 'Investigating', capa_pending: 'CAPA Pending', verification: 'Verification', closed: 'Closed', } export function IncidentHeader({ incidentId, referenceNo, status, backHref, canTriage, canInvestigate, canAddCapa, }: Props) { return (
← Incidents | {referenceNo ?? 'Pending'} {STATUS_LABELS[status] ?? status.replace(/_/g, ' ')}
{canTriage && ( Triage )} {canInvestigate && ( Investigate )} {canAddCapa && ( Add CAPA )}
) }