import { EventFragment, EventOccurrence } from "@/gql/graphql";
import { getClient } from "@/app/client";
import { EventContainer } from "@/components/events/EventContainer";
import { allEventsQuery } from "@/lib/event";
import { PageHeader } from "@/components/general/PageHeader";

export default async function Page() {
  const { data, error } = await getClient().query(allEventsQuery, {});
  const events = (data?.events ?? []) as EventFragment[];

  return (
    <main className="site-main" id="main">
      <PageHeader heading="Dette skjer på Chateau Neuf" />
      <EventContainer events={events} />
    </main>
  );
}
