web: move page rendering logic from page.tsx to components

This commit is contained in:
2026-05-19 17:00:12 +02:00
parent cf945d8647
commit 0c5a9876d6
30 changed files with 1419 additions and 1239 deletions
+5 -35
View File
@@ -1,37 +1,13 @@
import { Metadata, ResolvingMetadata } from "next";
import { notFound } from "next/navigation";
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";
import {
ContactIndexView,
contactQuery,
} from "@/components/contact/ContactIndexView";
import { getSeoMetadata } from "@/lib/seo";
const contactQuery = graphql(`
query contacts {
index: contactIndex {
... on ContactIndex {
...ContactIndex
}
}
}
`);
const ContactIndexDefinition = graphql(`
fragment ContactIndex on ContactIndex {
... on ContactIndex {
title
seoTitle
searchDescription
lead
body {
...Blocks
}
}
}
`);
export async function generateMetadata(
{ params }: { params: Promise<{}> },
parent: ResolvingMetadata
@@ -62,11 +38,5 @@ export default async function Page() {
const index = data.index as ContactIndexFragment;
return (
<main className="site-main" id="main">
<PageHeader heading={index.title} lead={index.lead} />
<GeneralContactBlock />
{index.body && <PageContent blocks={index.body} />}
</main>
);
return <ContactIndexView index={index} />;
}