feat: split alcohol and urine test into separate fields
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ interface Investigation {
|
||||
findings_text: string | null
|
||||
root_cause_summary: string | null
|
||||
alcohol_test_result: string | null
|
||||
urine_test_result: string | null
|
||||
witness_statement_refs: string[]
|
||||
completed_at: string | null
|
||||
investigator: { name: string | null; email: string } | null
|
||||
@@ -23,6 +24,13 @@ const METHOD_LABELS = {
|
||||
other: 'Other Method',
|
||||
}
|
||||
|
||||
const TEST_RESULT_LABELS: Record<string, string> = {
|
||||
negative: 'Negative',
|
||||
positive: 'Positive',
|
||||
refused: 'Refused',
|
||||
pending: 'Result pending',
|
||||
}
|
||||
|
||||
export function InvestigationPanel({ investigation: inv }: Props) {
|
||||
const investigatorName = inv.investigator?.name ?? inv.investigator?.email ?? 'Unknown'
|
||||
|
||||
@@ -105,11 +113,21 @@ export function InvestigationPanel({ investigation: inv }: Props) {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Alcohol test */}
|
||||
{inv.alcohol_test_result && (
|
||||
<div>
|
||||
<h3 className="text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1">Alcohol Test Result</h3>
|
||||
<p className="text-sm text-gray-900">{inv.alcohol_test_result}</p>
|
||||
{/* Drug tests */}
|
||||
{(inv.alcohol_test_result || inv.urine_test_result) && (
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
{inv.alcohol_test_result && (
|
||||
<div>
|
||||
<h3 className="text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1">Alcohol Test</h3>
|
||||
<p className="text-sm text-gray-900">{TEST_RESULT_LABELS[inv.alcohol_test_result] ?? inv.alcohol_test_result}</p>
|
||||
</div>
|
||||
)}
|
||||
{inv.urine_test_result && (
|
||||
<div>
|
||||
<h3 className="text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1">Urine Test</h3>
|
||||
<p className="text-sm text-gray-900">{TEST_RESULT_LABELS[inv.urine_test_result] ?? inv.urine_test_result}</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user