import { notFound } from 'next/navigation';
import { TeamsPageQuery } from '@/lib/page-queries/page-queries/TeamsPageQuery';
import { TeamsPageClient } from './TeamsPageClient';

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

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

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