import type { Metadata } from "next"; import Link from "next/link"; import { Hero } from "@/components/Hero"; import { Button } from "@/components/Button"; import { Section, SectionHeading } from "@/components/Section"; import { AngebotCard } from "@/components/AngebotCard"; import { ImagePlaceholder } from "@/components/ImagePlaceholder"; import { RichText } from "@/components/RichText"; import { CTA } from "@/components/CTA"; import { Reveal } from "@/components/Reveal"; import { EventTeaserCard } from "@/components/EventTeaserCard"; import { getOffers, getPosts, getUpcomingEvents } from "@/lib/payload/content"; import { getHomeGlobal } from "@/lib/payload/globals"; import { groupOffersByCategory, moodForOffer } from "@/lib/angebote"; import { mediaAlt, mediaUrl } from "@/lib/payload/media"; export const dynamic = "force-dynamic"; export async function generateMetadata(): Promise { const home = await getHomeGlobal(); return { title: { absolute: home.heroTitle || "Willkommen bei Anouma" }, description: home.heroSupporting || "Prozessbegleitung, Doula-Begleitung, Kindergruppen und Singkreise — Räume für Verbindung mit dir selbst, miteinander und mit der Natur.", }; } export default async function Home() { const [home, offers, posts, events] = await Promise.all([ getHomeGlobal(), getOffers(), getPosts(3), getUpcomingEvents(3), ]); const groups = groupOffersByCategory(offers); return ( <> } > {home.heroHighlight &&

{home.heroHighlight}

} {home.heroSupporting && (

{home.heroSupporting}

)}
{groups.map((group, i) => { const isSingle = group.offers.length === 1; const first = group.offers[0]; return ( ); })}
{(home.aboutTitle || home.aboutText) && (
{home.aboutEyebrow && (

{home.aboutEyebrow}

)} {home.aboutTitle && (

{home.aboutTitle}

)} {home.aboutText && (
)}
)} {home.values && home.values.length > 0 && (
{home.values.map((wert, i) => (

{wert.title}

„{wert.quote}“

))}
)} {events.length > 0 && (
{events.map((event, i) => ( ))}
)} {posts.length > 0 && (
{posts.map((post, i) => (

{new Date(post.publishDate ?? post.createdAt).toLocaleDateString("de-DE", { day: "2-digit", month: "long", year: "numeric", })}

{post.title}

{post.teaser}

))}
)}
{(["moss", "rose", "peach", "sand"] as const).map((mood, i) => ( ))}
Alle Impressionen ansehen
); }