1ab4088bf0
New ProductBlocks.tsx renders a product's layout — delegates to PageBlocks.tsx's renderPageBlockSync for the 9 block types shared with Pages.layout, handles productHero/productPricingPanel itself (need live product/shipping/tax context a generic content page doesn't have). Converts /einfach-anfangen to render through this instead of its own Hero/HowItWorks/Focus/Pricing components (now deleted) — the first PDP built as CMS blocks end to end. der-eine/todo-cards/tasse-die-pause are untouched. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J1Hu5bZ1kZUgKhab6yNwCt
49 lines
2.0 KiB
TypeScript
49 lines
2.0 KiB
TypeScript
import type { Metadata } from "next";
|
||
import { notFound } from "next/navigation";
|
||
import { ProductBlocks } from "../components/ProductBlocks";
|
||
import { Footer } from "../components/Footer";
|
||
import { getProductBySlug, getCompanySettings } from "../lib/payload";
|
||
import { buildProductSchema } from "../lib/structuredData";
|
||
|
||
const title = "Einfach anfangen. – Die Karte für die Dinge, die heute anstehen.";
|
||
|
||
// Description reads from the live product, same pattern as der-eine/
|
||
// tasse-die-pause — see der-eine/page.tsx's own comment on why this and
|
||
// the hand-written Hero prose are allowed to differ.
|
||
export async function generateMetadata(): Promise<Metadata> {
|
||
const product = await getProductBySlug("todo-starter");
|
||
const description = product?.descriptionText || undefined;
|
||
return {
|
||
title,
|
||
description,
|
||
alternates: { canonical: "/einfach-anfangen" },
|
||
openGraph: { title, description, url: "/einfach-anfangen" },
|
||
twitter: { title, description },
|
||
};
|
||
}
|
||
|
||
// First PDP driven entirely by Products.layout (see that field's own
|
||
// comment in Products.ts) instead of its own bespoke Hero/HowItWorks/
|
||
// Focus/Pricing components — those were deleted once this product's
|
||
// content was authored as blocks in the admin (see the PDP page-builder
|
||
// rollout). der-eine/todo-cards/tasse-die-pause are untouched and keep
|
||
// their own hand-coded components; nothing about them depends on this.
|
||
export default async function EinfachAnfangenPage() {
|
||
const [product, seller] = await Promise.all([
|
||
getProductBySlug("todo-starter"),
|
||
getCompanySettings(),
|
||
]);
|
||
if (!product) notFound();
|
||
const productSchema = buildProductSchema(product, "https://einfach-produktiv.mk360.de/einfach-anfangen", seller);
|
||
|
||
return (
|
||
<>
|
||
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(productSchema) }} />
|
||
<main className="flex flex-col flex-1">
|
||
<ProductBlocks product={product} />
|
||
</main>
|
||
<Footer />
|
||
</>
|
||
);
|
||
}
|