import { notFound } from 'next/navigation';
import { SponsorDashboardPageQuery } from '@/lib/page-queries/SponsorDashboardPageQuery';
import { SponsorDashboardTemplate } from '@/templates/SponsorDashboardTemplate';

export default async function SponsorDashboardPage() {
  const pageQuery = new SponsorDashboardPageQuery();
  const result = await pageQuery.execute('demo-sponsor-1');

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

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