import EventLeaderboard from '@/ui/events/Leaderboard';
import { cookies } from 'next/headers';
import { notFound } from 'next/navigation';

export const metadata = {
  title: 'Tableau des scores - Peer-at Code',
  description: 'Suivez la progression des élèves en direct'
};

export default async function Page({ params }: { params: { id: number } }) {
  const { id } = params;

  if (!id) {
    notFound();
  }

  const token = cookies().get('token')?.value;
  return <EventLeaderboard token={token!} id={id} />;
}
