26ae4a15f4
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.
56 lines
1.6 KiB
TypeScript
56 lines
1.6 KiB
TypeScript
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 />
|
||
</>
|
||
);
|
||
}
|