From 4d327b16160596eb8223b3b10ddf7f69aae86aab Mon Sep 17 00:00:00 2001 From: Vula Builder Date: Sun, 26 Jul 2026 17:04:57 +0000 Subject: [PATCH] Deploy --- src/components/sections/RoomsSection.tsx | 96 ++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 src/components/sections/RoomsSection.tsx diff --git a/src/components/sections/RoomsSection.tsx b/src/components/sections/RoomsSection.tsx new file mode 100644 index 0000000..b73ee31 --- /dev/null +++ b/src/components/sections/RoomsSection.tsx @@ -0,0 +1,96 @@ +'use client' + +import { useMedusaProducts } from '@/hooks/useMedusaProducts' +import Image from 'next/image' +import Link from 'next/link' +import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/Card' +import Button from '@/components/ui/Button' +import Badge from '@/components/ui/Badge' + +const CURRENCY_SYMBOLS: Record = { zar: 'R', usd: '$', eur: '€', gbp: '£' } +const formatPrice = (amount: number, code?: string) => { + const sym = CURRENCY_SYMBOLS[(code ?? '').toLowerCase()] ?? (code?.toUpperCase() ?? '') + return `${sym}${(amount / 100).toFixed(0)}` +} + +export default function RoomsSection() { + const { products: rooms, isLoading } = useMedusaProducts(6) + + return ( +
+
+
+

+ Six exclusive suites +

+

+ Suites designed for the bush +

+

+ Each suite tells a story — Zulu beadwork, private decks, freestanding baths overlooking the acacia plain. +

+
+ + {isLoading ? ( +
+
+

Loading suites...

+
+ ) : ( +
+ {rooms && rooms.length > 0 ? rooms.map((room: any) => { + const price = room.variants?.[0]?.prices?.[0] + const imageUrl = room.thumbnail || 'https://images.pexels.com/photos/8849246/pexels-photo-8849246.jpeg?auto=compress&cs=tinysrgb&h=350' + + return ( + +
+ {room.title +
+ +
+ + {room.title || 'Bush Suite'} + + {price && ( + + {formatPrice(price.amount, price.currency_code)} / night + + )} +
+
+ +

+ {room.description || 'Enjoy panoramic views, en-suite bathroom with outdoor shower, and a private deck.'} +

+ + + +
+
+ ) + }) : ( +

No suites available at the moment. Please check back soon.

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