Add the low-stock hint to TodoKartenHero.tsx too

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 <noreply@anthropic.com>
This commit is contained in:
Marco
2026-07-23 06:36:36 +00:00
parent 2df4dc7ea7
commit 21e150f177
2 changed files with 9 additions and 2 deletions
@@ -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 (
<section className="bg-bg-base w-full overflow-hidden">
@@ -111,6 +113,9 @@ export async function TodoKartenHero() {
<p className="text-label text-text-muted">
Lieferzeit: {shipping.totalDays.min}{shipping.totalDays.max} Werktage innerhalb Deutschlands
</p>
{/* Single product, no grid siblings to stay equal-height with —
plain conditional line, same reasoning as ProductSpotlight.tsx/Pricing.tsx. */}
{anyLowStock && <p className="text-label font-bold text-warning">Nur noch wenige verfügbar</p>}
</div>
{product && (