import { cookies } from 'next/headers' import { redirect } from 'next/navigation' import { supabase } from '@/lib/supabase' import { LogoutButton } from '@/components/logout-button' import { RealtimeClock } from '@/components/realtime-clock' import { FeatureCard } from '@/components/feature-card' import { Activity, User, CreditCard, Phone, Users, TrendingUp, ClipboardList, Building2, Calendar } from 'lucide-react' export default async function DashboardPage() { const cookieStore = await cookies() const sessionCookie = cookieStore.get('user_session') if (!sessionCookie) { redirect('/') } const session = JSON.parse(sessionCookie.value) if (session.role !== 'admin') { redirect('/') } const { data: petugas, error } = await supabase .from('petugas_posyandu') .select('*') .eq('id', session.id) .single() if (error || !petugas) { return
Error loading profile.
} return (
{/* Header */}

HealthPortal

DASHBOARD

{/* Main Single Frame */}
{/* Top Section - Welcome & Clock */}

Selamat Datang!

Anda log in sebagai {petugas.nama}

{/* Bottom Section - Details Grid */}
{/* Nama */}
Nama
{petugas.nama}
{/* Username */}
Username
{petugas.username}
{/* Nomor Petugas - Full Width */}
Nomor Petugas
{petugas.nomor_petugas}
{/* No Telp - Full Width */}
Nomor Telepon
{petugas.no_telp || '-'}
{/* Feature Menu Grid */}
{/* 1. Manajemen Akun */} {/* 2. Trend Stunting Daerah */} {/* 3. Kelola Data */} {/* 4. Manajemen Posyandu */} {/* 5. Kelola Jadwal Posyandu */}
) }