From 21e150f1771e72da6aca5b4967ae539557e76357 Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 23 Jul 2026 06:36:36 +0000 Subject: [PATCH] Add the low-stock hint to TodoKartenHero.tsx too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Missed in the earlier pass — /todo-cards has two independent purchase CTAs (the hero at the top and the Pricing panel further down), and only Pricing.tsx got the low-stock text line. The hero had no low-stock logic at all before this. Co-Authored-By: Claude Sonnet 5 --- README.md | 6 ++++-- app/todo-cards/components/TodoKartenHero.tsx | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 960f43a..d34ac7e 100644 --- a/README.md +++ b/README.md @@ -395,8 +395,10 @@ exposed in the public `Product` type, only this derived boolean — the public API has no reason to leak exact counts. Shown as a "Nur noch wenige verfügbar" **text line** (`text-warning`, the same `--color-warning` token in `globals.css`, distinct from the brand-colored discount badge) next to -the price on `ProductGrid.tsx`/`ProductSpotlight.tsx`/ -`RelatedProducts.tsx`/todo-cards' `Pricing.tsx` and — variant-specific, not +the price on `ProductGrid.tsx`/`ProductSpotlight.tsx`/`RelatedProducts.tsx`/ +todo-cards' `TodoKartenHero.tsx` and `Pricing.tsx` (both — the page has two +independent purchase CTAs, hero and pricing panel, each with their own +price/delivery block) and — variant-specific, not "any variant low" — under the product name in `CartContent.tsx`'s own cart line items, plus the existing `"(nur noch wenige)"` variant-select suffix in `AddToCartButton`/`AddToCartInlineButton`. The image-overlaid diff --git a/app/todo-cards/components/TodoKartenHero.tsx b/app/todo-cards/components/TodoKartenHero.tsx index f33bbf0..7212a01 100644 --- a/app/todo-cards/components/TodoKartenHero.tsx +++ b/app/todo-cards/components/TodoKartenHero.tsx @@ -26,6 +26,8 @@ export async function TodoKartenHero() { ]); const discount = product ? discountPercent(product.price, product.compareAtPrice) : null; const taxRate = product ? effectiveTaxRate(product, defaultTaxRate) : null; + // Same "any vs. every" split as ProductGrid.tsx/Pricing.tsx. + const anyLowStock = product ? (product.variants.length > 0 ? product.variants.some((v) => v.lowStock) : product.lowStock) : false; return (
@@ -111,6 +113,9 @@ export async function TodoKartenHero() {

Lieferzeit: {shipping.totalDays.min}–{shipping.totalDays.max} Werktage innerhalb Deutschlands

+ {/* Single product, no grid siblings to stay equal-height with — + plain conditional line, same reasoning as ProductSpotlight.tsx/Pricing.tsx. */} + {anyLowStock &&

Nur noch wenige verfügbar

} {product && (