feat(todo-cards): show price next to the hero CTA

The hero's "ToDo-Karten bestellen" button had no price anywhere near
it — a shopper had to scroll past the whole page to the Pricing
panel to find out what it costs. Adds a compact price line above
the button (same strikethrough+price style as ProductSpotlight),
fetched from the same "todo-karten" product Pricing.tsx already
reads further down.
This commit is contained in:
Marco
2026-07-19 23:37:32 +00:00
parent 4293df674f
commit f973eccca6
+20 -1
View File
@@ -2,6 +2,8 @@ import Link from "next/link";
import Image from "next/image";
import { AddToCartButton } from "../../components/AddToCartButton";
import { Reveal } from "../../components/Reveal";
import { getProductBySlug } from "../../lib/payload";
import { formatPrice, discountPercent } from "../../lib/format";
const checklist = [
"Klarer Fokus auf das, was wirklich zählt",
@@ -9,7 +11,14 @@ const checklist = [
"Minimalistisch, analog, effektiv",
];
export function TodoKartenHero() {
// Same "todo-karten" product Pricing.tsx reads further down the page —
// this is just a compact early teaser so the hero's CTA isn't asking for
// a click without saying what it costs; the full price/VAT/shipping-time
// detail still lives only in Pricing.tsx, not duplicated here.
export async function TodoKartenHero() {
const product = await getProductBySlug("todo-karten");
const discount = product ? discountPercent(product.price, product.compareAtPrice) : null;
return (
<section className="bg-bg-base w-full overflow-hidden">
{/* Same lg:-only structural exception as the Home Hero (see
@@ -81,6 +90,16 @@ export function TodoKartenHero() {
))}
</ul>
{product && (
<div className="flex gap-2 items-baseline">
{discount !== null && (
<p className="text-body text-text-muted line-through">{formatPrice(product.compareAtPrice!)}</p>
)}
<p className="font-bold text-h3 text-text-primary">{formatPrice(product.price)}</p>
<p className="text-label text-text-muted">inkl. MwSt.</p>
</div>
)}
<AddToCartButton label="ToDo-Karten bestellen" />
</div>
</Reveal>