import type { Metadata } from "next"; import { PageHeader } from "@/components/PageHeader"; import { Section, SectionHeading } from "@/components/Section"; import { ContactForm } from "@/components/ContactForm"; import { AngebotCard } from "@/components/AngebotCard"; import { Reveal } from "@/components/Reveal"; import { getBookingGlobal, getContactGlobal } from "@/lib/payload/globals"; import { getOffers } from "@/lib/payload/content"; import { moodForOffer } from "@/lib/angebote"; import { mediaUrl } from "@/lib/payload/media"; export const dynamic = "force-dynamic"; export async function generateMetadata(): Promise { const booking = await getBookingGlobal(); return { title: booking.title || "Termin buchen", description: booking.lead || "Kennenlernen & Termine vereinbaren.", }; } export default async function TerminBuchenPage() { const [booking, contact, offers] = await Promise.all([getBookingGlobal(), getContactGlobal(), getOffers()]); const bookableOffers = offers.filter((offer) => offer.bookable); return ( <> {bookableOffers.length > 0 && (
{bookableOffers.map((offer, i) => ( ))}
)} {booking.steps && booking.steps.length > 0 && (
{booking.steps.map((s, i) => (

{String(i + 1).padStart(2, "0")}

{s.title}

{s.text}

))}
)}
0 ? "Für einen konkreten Termin wähle oben ein Angebot — hier kannst du auch einfach eine allgemeine Nachricht schreiben." : undefined } align="left" />
{booking.formNote && (

{booking.formNote}

)}
); }