--- import Layout from '../layouts/Layout.astro'; import ProductCard from '../components/ProductCard.astro'; import { getPriceDropsFromDB } from '../lib/products'; function getDiscountPercent(sneaker: { originalPrice: number; lowestPrice: number }): number { return Math.round(((sneaker.originalPrice - sneaker.lowestPrice) / sneaker.originalPrice) * 100); } const deals = await getPriceDropsFromDB(24); const analyticsItems = deals.map((s, i) => ({ item_id: s.id, item_name: `${s.brand} ${s.name}`, item_brand: s.brand, price: s.lowestPrice, index: i })); ---

Deals & Prijsdalingen

Sneakers die recent in prijs zijn gedaald

{deals.length}
Actieve deals
-{Math.max(...deals.map(d => getDiscountPercent(d)))}%
Hoogste korting
€{Math.min(...deals.map(d => d.lowestPrice)).toFixed(0)}
Vanaf prijs
{['Alle', '> 10%', '> 15%', '> 20%'].map((label, i) => ( ))}
{deals.map((sneaker, i) => ( ))}