feat: add protected role dashboard placeholders
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,9 @@
|
||||
// app/(protected)/admin/page.tsx
|
||||
export default function AdminHome() {
|
||||
return (
|
||||
<main className="p-8 max-w-4xl mx-auto">
|
||||
<h1 className="text-2xl font-bold">Admin Dashboard</h1>
|
||||
<p className="mt-2 text-gray-500">Phase 0: User management and site config coming here.</p>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// app/(protected)/capa-owner/page.tsx
|
||||
export default function CapaOwnerHome() {
|
||||
return (
|
||||
<main className="p-8 max-w-4xl mx-auto">
|
||||
<h1 className="text-2xl font-bold">CAPA Owner Dashboard</h1>
|
||||
<p className="mt-2 text-gray-500">Phase 2: CAPA board coming here.</p>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// app/(protected)/hse/page.tsx
|
||||
export default function HSEHome() {
|
||||
return (
|
||||
<main className="p-8 max-w-4xl mx-auto">
|
||||
<h1 className="text-2xl font-bold">HSE Officer Dashboard</h1>
|
||||
<p className="mt-2 text-gray-500">Phase 1: Incident inbox + triage coming here.</p>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
@@ -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}</>
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// app/(protected)/management/page.tsx
|
||||
export default function ManagementHome() {
|
||||
return (
|
||||
<main className="p-8 max-w-4xl mx-auto">
|
||||
<h1 className="text-2xl font-bold">Management Dashboard</h1>
|
||||
<p className="mt-2 text-gray-500">Phase 1: KPI dashboard coming here.</p>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// app/(protected)/reporter/page.tsx
|
||||
export default function ReporterHome() {
|
||||
return (
|
||||
<main className="p-8 max-w-4xl mx-auto">
|
||||
<h1 className="text-2xl font-bold">Reporter Dashboard</h1>
|
||||
<p className="mt-2 text-gray-500">Phase 1: Incident report form coming here.</p>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// app/(protected)/supervisor/page.tsx
|
||||
export default function SupervisorHome() {
|
||||
return (
|
||||
<main className="p-8 max-w-4xl mx-auto">
|
||||
<h1 className="text-2xl font-bold">Supervisor Dashboard</h1>
|
||||
<p className="mt-2 text-gray-500">Phase 1: Incident inbox coming here.</p>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user