import { notFound } from 'next/navigation';
import { TeamLeaderboardPageQuery } from '@/lib/page-queries/TeamLeaderboardPageQuery';
import { TeamLeaderboardPageWrapper } from '@/client-wrapper/TeamLeaderboardPageWrapper';

export default async function TeamLeaderboardPage() {
  const query = new TeamLeaderboardPageQuery();
  const result = await query.execute();

  if (result.isErr()) {
    notFound();
  }

  const data = result.unwrap();
  return <TeamLeaderboardPageWrapper viewData={data} />;
}
