import { prisma } from "@/lib/prisma";
import PengurusTable from "@/components/admin/pengurus-table";

export const revalidate = 0; // Disable full caching for dashboard pages

export default async function AdminPengurusPage() {
    const [pengurus, bidangLembaga] = await Promise.all([
        prisma.pengurus.findMany({
            orderBy: [
                { divisi: 'asc' },
                { nama: 'asc' }
            ]
        }),
        prisma.bidangLembaga.findMany({
            orderBy: { name: 'asc' }
        })
    ]);

    return (
        <div className="space-y-6">
            <PengurusTable 
                initialData={pengurus || []} 
                bidangLembagaList={bidangLembaga || []} 
            />
        </div>
    );
}
