From fc0c6f0e28dd561c5a186a98b33a93bdaab67bbd Mon Sep 17 00:00:00 2001 From: Vula Builder Date: Tue, 28 Jul 2026 13:27:26 +0000 Subject: [PATCH] Deploy --- .../sections/FeaturedCollectionsSection.tsx | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 src/components/sections/FeaturedCollectionsSection.tsx diff --git a/src/components/sections/FeaturedCollectionsSection.tsx b/src/components/sections/FeaturedCollectionsSection.tsx new file mode 100644 index 0000000..6a1bdbb --- /dev/null +++ b/src/components/sections/FeaturedCollectionsSection.tsx @@ -0,0 +1,92 @@ +'use client' + +import { useMedusaProducts } from '@/hooks/useMedusaProducts' +import { useMedusaCart } from '@/hooks/useMedusaCart' +import { Card, CardHeader, CardTitle, CardContent, CardFooter } from '@/components/ui/Card' +import Button from '@/components/ui/Button' +import Badge from '@/components/ui/Badge' +import Image from 'next/image' +import Link from 'next/link' + +const formatPrice = (amount: number, code?: string) => { + const syms: Record = { zar: 'R', usd: '$', eur: '€' } + const sym = syms[(code || '').toLowerCase()] || (code?.toUpperCase() || 'R') + return `${sym}${(amount / 100).toFixed(2)}` +} + +export default function FeaturedCollectionsSection() { + const { products, isLoading } = useMedusaProducts(8) + const { addToCart } = useMedusaCart() + + if (isLoading) { + return ( + + ) + } + + if (!products || products.length === 0) return null + + return ( + + ) +}