41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import { graphql } from "@/gql";
|
|
import { ContactIndexFragment } from "@/gql/graphql";
|
|
import { getClient } from "@/app/client";
|
|
import { PageHeader } from "@/components/general/PageHeader";
|
|
import { PageContent } from "@/components/general/PageContent";
|
|
import { GeneralContactBlock } from "@/components/blocks/GeneralContactBlock";
|
|
|
|
const ContactIndexDefinition = graphql(`
|
|
fragment ContactIndex on ContactIndex {
|
|
... on ContactIndex {
|
|
title
|
|
lead
|
|
body {
|
|
...Blocks
|
|
}
|
|
}
|
|
}
|
|
`);
|
|
|
|
export default async function Page() {
|
|
const contactQuery = graphql(`
|
|
query contacts {
|
|
contactIndex {
|
|
... on ContactIndex {
|
|
...ContactIndex
|
|
}
|
|
}
|
|
}
|
|
`);
|
|
const { data, error } = await getClient().query(contactQuery, {});
|
|
const index = (data?.contactIndex ?? []) as ContactIndexFragment;
|
|
|
|
return (
|
|
<main className="site-main" id="main">
|
|
<PageHeader heading={index.title} lead={index.lead} />
|
|
<GeneralContactBlock />
|
|
{index.body && <PageContent blocks={index.body} />}
|
|
</main>
|
|
);
|
|
}
|