Files
ims/app/(protected)/hse/incidents/page.tsx
T

30 lines
986 B
TypeScript

export const dynamic = 'force-dynamic'
import { createClient } from '@/lib/supabase/server'
import { IncidentList, type Incident } from '@/components/incidents/incident-list'
export default async function HseInboxPage() {
const supabase = await createClient()
const { data: incidents } = await supabase
.from('incidents')
.select(`
id, reference_no, incident_type, status, severity, reported_at,
sites (name),
zones (name),
reporter:users!reported_by (name)
`)
.order('reported_at', { ascending: false })
.limit(100)
return (
<main className="max-w-4xl mx-auto px-4 py-6">
<div className="flex items-center justify-between mb-6">
<h1 className="text-2xl font-bold text-gray-900">Incident Inbox</h1>
<span className="text-sm text-gray-500">{incidents?.length ?? 0} incidents</span>
</div>
<IncidentList incidents={(incidents ?? []) as unknown as Incident[]} basePath="/hse" />
</main>
)
}