Files
einfach-produktiv/app/todo-cards/page.tsx
T
Marco 26ae4a15f4 Wire testimonials CMS collection and Payload Live Preview
Testimonials on /todo-cards, /newsletter, /challenge now come from the new
Payload testimonials collection via a shared TestimonialsGrid component,
instead of 3 separately hardcoded arrays.

Adds Next.js Draft Mode (/api/preview) plus Live-Preview-aware client
wrappers (LiveRichText, LiveTestimonialsGrid, LivePostContent) for posts,
legal pages, and testimonials — mounted only while Draft Mode is enabled,
so ordinary visitors keep getting the plain static components.
2026-07-21 19:02:20 +00:00

56 lines
1.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { Metadata } from "next";
import { draftMode } from "next/headers";
import { TodoKartenHero } from "./components/TodoKartenHero";
import { HowItWorks } from "./components/HowItWorks";
import { Focus } from "./components/Focus";
import { Pricing } from "./components/Pricing";
import { Footer } from "../components/Footer";
import { TestimonialsGrid } from "../components/TestimonialsGrid";
import { LiveTestimonialsGrid } from "../components/LiveTestimonialsGrid";
import { getTestimonials } from "../lib/payload";
const title = "ToDo-Karten Kleine Karten. Große Wirkung.";
const description =
"Ein einfaches Werkzeug, das dir hilft, deinen Kopf frei zu bekommen und das Wesentliche zu sehen. 50 hochwertige ToDo-Karten für mehr Fokus im Alltag.";
export const metadata: Metadata = {
title,
description,
alternates: {
canonical: "/todo-cards",
},
openGraph: {
title,
description,
url: "/todo-cards",
images: ["/hero-todo-karten.png"],
},
twitter: {
title,
description,
images: ["/hero-todo-karten.png"],
},
};
export default async function TodoCardsPage() {
const testimonials = await getTestimonials("todo-cards");
const { isEnabled: isPreview } = await draftMode();
return (
<>
<main className="flex flex-col flex-1">
<TodoKartenHero />
<HowItWorks />
<Focus />
{isPreview ? (
<LiveTestimonialsGrid testimonials={testimonials} />
) : (
<TestimonialsGrid testimonials={testimonials} />
)}
<Pricing />
</main>
<Footer />
</>
);
}