From e58dd7e2104abf2d2c554a0d2b5871df852f9ded Mon Sep 17 00:00:00 2001 From: Vula Builder Date: Sun, 11 Oct 2026 14:20:27 +0000 Subject: [PATCH] Deploy --- .../sections/FeaturedDishesSection.tsx | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 src/components/sections/FeaturedDishesSection.tsx diff --git a/src/components/sections/FeaturedDishesSection.tsx b/src/components/sections/FeaturedDishesSection.tsx new file mode 100644 index 0000000..94ee609 --- /dev/null +++ b/src/components/sections/FeaturedDishesSection.tsx @@ -0,0 +1,82 @@ +'use client' +import { useFeaturedProducts } from '@/hooks/useFeaturedProducts' +import Link from 'next/link' +import { Utensils } from 'lucide-react' +import { useVulaCart } from '@/hooks/useVulaCart' + +const CURRENCY_SYMBOLS: Record = { zar: 'R', usd: '$', eur: '€', gbp: '£', kes: 'KSh', ngn: '₦', ghs: '₵' } +const fmt = (amount: number, code?: string) => { + const sym = CURRENCY_SYMBOLS[(code ?? '').toLowerCase()] ?? (code?.toUpperCase() ?? '') + return `${sym}${(amount / 100).toFixed(2)}` +} + +export default function FeaturedDishesSection() { + const { products: dishes, isLoading } = useFeaturedProducts(8) + const { addToCart } = useVulaCart() + + if (isLoading) { + return ( +
+
+
+ {Array.from({ length: 8 }).map((_, i) => ( +
+ ))} +
+
+
+ ) + } + + if (!dishes.length) return null + + return ( +
+
+
+
+

Chef's Selection

+

Featured Dishes

+
+ Full Menu → +
+
+ {dishes.map((dish) => { + const variant = dish.variants?.[0] + const price = variant?.prices?.[0] + return ( +
+ +
+ {dish.thumbnail ? ( + {dish.title + ) : ( +
+ +
+ )} +
+ +
+ +

{dish.title}

+ + {price && ( +

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

+ )} + +
+
+ ) + })} +
+
+
+ ) +}