import { getAllAwardeePH, getAllPengurus } from '@/lib/admin-actions';
import AwardeeClientPage from '@/components/admin/awardee-client-page';
import { Trophy } from 'lucide-react';

export const dynamic = 'force-dynamic';
export const revalidate = 0;

export default async function AdminAwardeePage() {
    const [awardees, pengurus] = await Promise.all([
        getAllAwardeePH(),
        getAllPengurus(),
    ]);

    return (
        <div className="space-y-6">
            <div>
                <div className="flex items-center gap-3 mb-1">
                    <div className="p-2 bg-primary/10 rounded-lg">
                        <Trophy className="h-6 w-6 text-primary" />
                    </div>
                    <h1 className="text-3xl font-bold tracking-tight">Pengurus HMF Terbaik</h1>
                </div>
                <p className="text-muted-foreground ml-[52px]">
                    Kelola data awardee pengurus himpunan terbaik per periode.
                </p>
            </div>
            <AwardeeClientPage
                initialAwardees={JSON.parse(JSON.stringify(awardees))}
                pengurusList={JSON.parse(JSON.stringify(pengurus))}
            />
        </div>
    );
}
