Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AWxyMibCuGGtSQSqfajDQ7
28 lines
1.1 KiB
TypeScript
28 lines
1.1 KiB
TypeScript
export const dynamic = 'force-dynamic'
|
|
|
|
import Link from 'next/link'
|
|
import { createClient } from '@/lib/supabase/server'
|
|
import { redirect } from 'next/navigation'
|
|
|
|
export default async function SupervisorPage() {
|
|
const supabase = await createClient()
|
|
const { data: { user } } = await supabase.auth.getUser()
|
|
if (!user) redirect('/login')
|
|
|
|
const { data: profile } = await supabase.from('users').select('name').eq('id', user.id).single()
|
|
|
|
return (
|
|
<main className="max-w-4xl mx-auto px-4 py-6">
|
|
<h1 className="text-2xl font-bold text-gray-900 mb-1">Supervisor Portal</h1>
|
|
<p className="text-gray-500 text-sm mb-8">Welcome, {profile?.name ?? user.email}</p>
|
|
<div className="grid grid-cols-2 gap-4 sm:grid-cols-3">
|
|
<Link href="/supervisor/incidents" className="bg-white rounded-xl shadow-sm p-5 hover:shadow-md transition-shadow border border-gray-100">
|
|
<div className="text-2xl mb-2">📋</div>
|
|
<div className="font-semibold text-gray-900">Incident Inbox</div>
|
|
<div className="text-xs text-gray-500 mt-1">View site incidents</div>
|
|
</Link>
|
|
</div>
|
|
</main>
|
|
)
|
|
}
|