feat(capa): restyle the create CAPA form and page with the shared field primitives

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 11:38:44 +08:00
co-authored by Claude Haiku 4.5
parent 587b580797
commit 40878c126a
3 changed files with 132 additions and 42 deletions
@@ -1,5 +1,6 @@
import { notFound, redirect } from 'next/navigation'
import Link from 'next/link'
import { ArrowLeft } from 'lucide-react'
import { asAdmin } from '@/lib/db/with-user'
import { getSession } from '@/lib/auth/get-session'
import { incidents } from '@/lib/db/schema'
@@ -30,15 +31,18 @@ export default async function NewCapaPage({ params }: Props) {
if (!incident) notFound()
return (
<main className="max-w-lg mx-auto px-4 py-6">
<Link href={`/hse/incidents/${id}`} className="text-sm text-accent-700 hover:underline mb-4 inline-block">
← Back to incident
<div className="max-w-xl space-y-4 px-4 py-5 md:px-8 md:py-6">
<Link href={`/hse/incidents/${id}`} className="inline-flex items-center gap-1 text-[13px] text-accent hover:underline">
<ArrowLeft size={14} strokeWidth={2} aria-hidden />
Back to incident
</Link>
<h1 className="text-xl font-bold text-gray-900 mb-1">Add CAPA Action</h1>
<p className="text-sm text-gray-500 mb-6">
{incident.referenceNo ?? id}
</p>
<CapaForm incidentId={id} />
</main>
<div>
<h1 className="text-xl font-[650]">Add CAPA action</h1>
<p className="mt-0.5 font-mono text-[12.5px] text-muted">{incident.referenceNo ?? id}</p>
</div>
<div className="rounded-xl bg-surface p-5 shadow-card">
<CapaForm incidentId={id} />
</div>
</div>
)
}