From c3ba543ebb44e71b2b0088fadd2ceeac5e30e2eb Mon Sep 17 00:00:00 2001 From: weeihan Date: Thu, 9 Jul 2026 22:32:29 +0800 Subject: [PATCH] feat: add protected role dashboard placeholders Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01AWxyMibCuGGtSQSqfajDQ7 --- app/(protected)/admin/page.tsx | 9 +++++++++ app/(protected)/capa-owner/page.tsx | 9 +++++++++ app/(protected)/hse/page.tsx | 9 +++++++++ app/(protected)/layout.tsx | 18 ++++++++++++++++++ app/(protected)/management/page.tsx | 9 +++++++++ app/(protected)/reporter/page.tsx | 9 +++++++++ app/(protected)/supervisor/page.tsx | 9 +++++++++ 7 files changed, 72 insertions(+) create mode 100644 app/(protected)/admin/page.tsx create mode 100644 app/(protected)/capa-owner/page.tsx create mode 100644 app/(protected)/hse/page.tsx create mode 100644 app/(protected)/layout.tsx create mode 100644 app/(protected)/management/page.tsx create mode 100644 app/(protected)/reporter/page.tsx create mode 100644 app/(protected)/supervisor/page.tsx diff --git a/app/(protected)/admin/page.tsx b/app/(protected)/admin/page.tsx new file mode 100644 index 0000000..b7665a6 --- /dev/null +++ b/app/(protected)/admin/page.tsx @@ -0,0 +1,9 @@ +// app/(protected)/admin/page.tsx +export default function AdminHome() { + return ( +
+

Admin Dashboard

+

Phase 0: User management and site config coming here.

+
+ ) +} diff --git a/app/(protected)/capa-owner/page.tsx b/app/(protected)/capa-owner/page.tsx new file mode 100644 index 0000000..3e88711 --- /dev/null +++ b/app/(protected)/capa-owner/page.tsx @@ -0,0 +1,9 @@ +// app/(protected)/capa-owner/page.tsx +export default function CapaOwnerHome() { + return ( +
+

CAPA Owner Dashboard

+

Phase 2: CAPA board coming here.

+
+ ) +} diff --git a/app/(protected)/hse/page.tsx b/app/(protected)/hse/page.tsx new file mode 100644 index 0000000..88fe2dd --- /dev/null +++ b/app/(protected)/hse/page.tsx @@ -0,0 +1,9 @@ +// app/(protected)/hse/page.tsx +export default function HSEHome() { + return ( +
+

HSE Officer Dashboard

+

Phase 1: Incident inbox + triage coming here.

+
+ ) +} diff --git a/app/(protected)/layout.tsx b/app/(protected)/layout.tsx new file mode 100644 index 0000000..9bb1fe3 --- /dev/null +++ b/app/(protected)/layout.tsx @@ -0,0 +1,18 @@ +// app/(protected)/layout.tsx +import { createClient } from '@/lib/supabase/server' +import { redirect } from 'next/navigation' + +export default async function ProtectedLayout({ + children, +}: { + children: React.ReactNode +}) { + const supabase = await createClient() + const { + data: { user }, + } = await supabase.auth.getUser() + + if (!user) redirect('/login') + + return <>{children} +} diff --git a/app/(protected)/management/page.tsx b/app/(protected)/management/page.tsx new file mode 100644 index 0000000..26d197f --- /dev/null +++ b/app/(protected)/management/page.tsx @@ -0,0 +1,9 @@ +// app/(protected)/management/page.tsx +export default function ManagementHome() { + return ( +
+

Management Dashboard

+

Phase 1: KPI dashboard coming here.

+
+ ) +} diff --git a/app/(protected)/reporter/page.tsx b/app/(protected)/reporter/page.tsx new file mode 100644 index 0000000..24dd17f --- /dev/null +++ b/app/(protected)/reporter/page.tsx @@ -0,0 +1,9 @@ +// app/(protected)/reporter/page.tsx +export default function ReporterHome() { + return ( +
+

Reporter Dashboard

+

Phase 1: Incident report form coming here.

+
+ ) +} diff --git a/app/(protected)/supervisor/page.tsx b/app/(protected)/supervisor/page.tsx new file mode 100644 index 0000000..a198281 --- /dev/null +++ b/app/(protected)/supervisor/page.tsx @@ -0,0 +1,9 @@ +// app/(protected)/supervisor/page.tsx +export default function SupervisorHome() { + return ( +
+

Supervisor Dashboard

+

Phase 1: Incident inbox coming here.

+
+ ) +}