From f8cdc1fd30653c969d5f4a05cc95b3b3cc6fd353 Mon Sep 17 00:00:00 2001 From: Vula Builder Date: Mon, 27 Jul 2026 18:34:54 +0000 Subject: [PATCH] Deploy --- .../sections/NewArrivalsSection.tsx | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/components/sections/NewArrivalsSection.tsx diff --git a/src/components/sections/NewArrivalsSection.tsx b/src/components/sections/NewArrivalsSection.tsx new file mode 100644 index 0000000..db7c98e --- /dev/null +++ b/src/components/sections/NewArrivalsSection.tsx @@ -0,0 +1,56 @@ +'use client' +import { useMedusaProducts } from '@/hooks/useMedusaProducts' +import Link from 'next/link' +import { Card, CardContent, CardFooter } from '@/components/ui/Card' +import Badge from '@/components/ui/Badge' +import Button from '@/components/ui/Button' +import { Eye } from 'lucide-react' + +const CURRENCY_SYMBOLS: Record = { zar: 'R', usd: '$', eur: '€', gbp: '£', kes: 'KSh', ngn: '₦', ghs: '₵' } +const formatPrice = (amount: number, code?: string) => { + const sym = CURRENCY_SYMBOLS[(code ?? '').toLowerCase()] ?? (code?.toUpperCase() ?? '') + return `${sym}${(amount / 100).toFixed(2)}` +} + +export default function NewArrivalsSection() { + const { products, isLoading } = useMedusaProducts(4) + if (isLoading) return
+ if (!products || products.length === 0) return null + return ( +
+
+

Fresh Off the Block: New Threads

+

Limited edition drops — grab yours before they vanish

+
+ {products.map((product) => { + const price = product.variants?.[0]?.prices?.[0] + return ( + +
+ {product.title} + Just Landed +
+ +

{product.title}

+ {price && ( +

{formatPrice(price.amount, price.currency_code)}

+ )} +
+ + + + + + + + +
+ ) + })} +
+
+
+ ) +} \ No newline at end of file