diff --git a/app/(protected)/hse/dashboard/page.tsx b/app/(protected)/hse/dashboard/page.tsx index b5b9fe6..c5fe64f 100644 --- a/app/(protected)/hse/dashboard/page.tsx +++ b/app/(protected)/hse/dashboard/page.tsx @@ -33,7 +33,7 @@ export default async function HseDashboardPage() { const siteMap: Record = {} for (const r of rows) { - const name = (r.sites as any)?.name ?? 'Unknown' + const name = (r.sites as { name: string } | null)?.name ?? 'Unknown' siteMap[name] = (siteMap[name] ?? 0) + 1 } const by_site = Object.entries(siteMap).map(([name, count]) => ({ name, count })) diff --git a/app/(protected)/hse/incidents/[id]/page.tsx b/app/(protected)/hse/incidents/[id]/page.tsx index 1895e0c..2f5b04e 100644 --- a/app/(protected)/hse/incidents/[id]/page.tsx +++ b/app/(protected)/hse/incidents/[id]/page.tsx @@ -3,7 +3,7 @@ export const dynamic = 'force-dynamic' import { notFound } from 'next/navigation' import Link from 'next/link' import { createClient } from '@/lib/supabase/server' -import { IncidentDetail } from '@/components/incidents/incident-detail' +import { IncidentDetail, type Incident } from '@/components/incidents/incident-detail' interface Props { params: Promise<{ id: string }> @@ -35,7 +35,7 @@ export default async function HseIncidentDetailPage({ params }: Props) { ← Back to inbox - + ) } diff --git a/app/(protected)/hse/incidents/page.tsx b/app/(protected)/hse/incidents/page.tsx index 8867ee4..0f9a2d4 100644 --- a/app/(protected)/hse/incidents/page.tsx +++ b/app/(protected)/hse/incidents/page.tsx @@ -1,7 +1,7 @@ export const dynamic = 'force-dynamic' import { createClient } from '@/lib/supabase/server' -import { IncidentList } from '@/components/incidents/incident-list' +import { IncidentList, type Incident } from '@/components/incidents/incident-list' export default async function HseInboxPage() { const supabase = await createClient() @@ -23,7 +23,7 @@ export default async function HseInboxPage() {

Incident Inbox

{incidents?.length ?? 0} incidents - + ) } diff --git a/app/(protected)/supervisor/incidents/[id]/page.tsx b/app/(protected)/supervisor/incidents/[id]/page.tsx index fc6b0e0..98f0aef 100644 --- a/app/(protected)/supervisor/incidents/[id]/page.tsx +++ b/app/(protected)/supervisor/incidents/[id]/page.tsx @@ -3,7 +3,7 @@ export const dynamic = 'force-dynamic' import { notFound } from 'next/navigation' import Link from 'next/link' import { createClient } from '@/lib/supabase/server' -import { IncidentDetail } from '@/components/incidents/incident-detail' +import { IncidentDetail, type Incident } from '@/components/incidents/incident-detail' interface Props { params: Promise<{ id: string }> @@ -35,7 +35,7 @@ export default async function SupervisorIncidentDetailPage({ params }: Props) { ← Back to inbox - + ) } diff --git a/app/(protected)/supervisor/incidents/page.tsx b/app/(protected)/supervisor/incidents/page.tsx index 5206b9d..a05c5f8 100644 --- a/app/(protected)/supervisor/incidents/page.tsx +++ b/app/(protected)/supervisor/incidents/page.tsx @@ -1,7 +1,7 @@ export const dynamic = 'force-dynamic' import { createClient } from '@/lib/supabase/server' -import { IncidentList } from '@/components/incidents/incident-list' +import { IncidentList, type Incident } from '@/components/incidents/incident-list' export default async function SupervisorInboxPage() { const supabase = await createClient() @@ -23,7 +23,7 @@ export default async function SupervisorInboxPage() {

Incident Inbox

{incidents?.length ?? 0} incidents - + ) } diff --git a/components/incidents/incident-detail.tsx b/components/incidents/incident-detail.tsx index f37aa92..55fe825 100644 --- a/components/incidents/incident-detail.tsx +++ b/components/incidents/incident-detail.tsx @@ -26,7 +26,7 @@ const MEDICAL_LABELS: Record = { lti: 'Lost Time Injury (LTI)', } -type Incident = { +export type Incident = { id: string reference_no: string | null incident_type: string diff --git a/components/incidents/incident-list.tsx b/components/incidents/incident-list.tsx index 45071bd..ef2b08b 100644 --- a/components/incidents/incident-list.tsx +++ b/components/incidents/incident-list.tsx @@ -22,7 +22,7 @@ const STATUS_COLORS: Record = { closed: 'bg-green-100 text-green-800', } -type Incident = { +export type Incident = { id: string reference_no: string | null incident_type: string