feat: incident inbox pages with filter/search for HSE and supervisor roles
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AWxyMibCuGGtSQSqfajDQ7
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
import { createClient } from '@/lib/supabase/server'
|
||||
import { IncidentList } from '@/components/incidents/incident-list'
|
||||
|
||||
export default async function SupervisorInboxPage() {
|
||||
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 any} basePath="/supervisor" />
|
||||
</main>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user