import type { Metadata } from "next"; import Link from "next/link"; import Image from "next/image"; import { draftMode } from "next/headers"; import { Reveal } from "../components/Reveal"; import { Footer } from "../components/Footer"; import { TrustRow } from "../components/TrustRow"; import { RichText, extractHeadings } from "../components/RichText"; import { LiveRichText } from "../components/LiveRichText"; import { SectionTOC, MobileSectionTOC } from "../components/SectionTOC"; import { getLegalPage, getCompanySettings } from "../lib/payload"; import { formatMonthYear } from "../lib/format"; import { VertragspartnerBlock, vertragspartnerHeadings } from "./components/VertragspartnerBlock"; export const metadata: Metadata = { title: "AGB", description: "Allgemeine Geschäftsbedingungen von einfach produktiv.", alternates: { canonical: "/agb" }, }; export default async function AgbPage() { const { isEnabled: isPreview } = await draftMode(); const [page, seller] = await Promise.all([getLegalPage("agb", { draft: isPreview }), getCompanySettings()]); // Section 1 ("Geltungsbereich") comes first from `content`, THEN // "2. Vertragspartner" (dynamic, sits between two CMS-driven halves — // see LegalPages.ts's `contentPart2` comment), then the rest from // `contentPart2`. const headings = [ ...(page ? extractHeadings(page.content) : []), ...vertragspartnerHeadings(), ...(page?.contentPart2 ? extractHeadings(page.contentPart2) : []), ]; return ( <>

Startseite AGB

Allgemeine Geschäftsbedingungen

{page &&

Stand: {formatMonthYear(page.updatedAt)}

}
{/* MobileSectionTOC — below lg: only, see SectionTOC.tsx's own comment. Outside the sidebar's `hidden lg:flex` wrapper below (that wrapper's `hidden` would hide this too otherwise). */}
{/* Static, not part of the CMS content — same reasoning as the Impressum/Datenschutz pages' own callout cards. */}

Unser Anspruch

Wir entwickeln Produkte, die dich im Alltag wirklich weiterbringen – mit Klarheit, Qualität und einem bewussten Umgang mit Ressourcen.

{page ? ( <> {isPreview ? : } {/* Name/Adresse/E-Mail kommen direkt aus company-settings, nicht aus der CMS-Richtext — single-sourced, gleiche Begründung wie Impressum/Datenschutz. */} {seller && } {page.contentPart2 ? ( isPreview ? : ) : null} ) : (

Inhalte werden gerade aktualisiert.

)}