From 00a169207b2223d15344b466b44a1eb7f69d41f2 Mon Sep 17 00:00:00 2001 From: Vula Builder Date: Sun, 26 Jul 2026 16:40:58 +0000 Subject: [PATCH] Deploy --- src/components/sections/RoomsSection.tsx | 116 +++++++++++++++++++++++ 1 file changed, 116 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..723cf2e --- /dev/null +++ b/src/components/sections/RoomsSection.tsx @@ -0,0 +1,116 @@ +'use client' + +import { useMedusaProducts } from "@/hooks/useMedusaProducts" +import { Card, CardHeader, CardTitle, CardContent, CardFooter } from "@/components/ui/Card" +import Button from "@/components/ui/Button" +import Link from "next/link" +import Image from "next/image" +import { Star } from 'lucide-react' + +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(2)}` +} + +const roomImages = [ + "https://images.pexels.com/photos/24738158/pexels-photo-24738158.jpeg?auto=compress&cs=tinysrgb&h=350", + "https://images.pexels.com/photos/18652120/pexels-photo-18652120.jpeg?auto=compress&cs=tinysrgb&h=350", + "https://images.pexels.com/photos/1973889/pexels-photo-1973889.jpeg?auto=compress&cs=tinysrgb&h=350", +] + +export default function RoomsSection() { + const { products: rooms, isLoading } = useMedusaProducts(6) + + if (isLoading) { + return ( +
+
+
+
+
+ {[1, 2, 3].map((i) => ( +
+ ))} +
+
+
+
+ ) + } + + const displayRooms = (rooms ?? []).slice(0, 6).map((room, idx) => ({ + ...room, + image: roomImages[idx % roomImages.length], + })) + + return ( +
+
+
+ + Venda-Inspired Accommodation + +

+ Six Rooms, Six Stories +

+

+ Each suite handcrafted with locally woven textiles and named after Venda clans and landmarks. +

+
+ +
+ {displayRooms.map((room) => { + const price = room.variants?.[0]?.prices?.[0] + return ( + +
+ {room.title} + {price && ( + + {formatPrice(price.amount, price.currency_code)} / night + + )} +
+ + + {room.title} + + + +

+ {room.description ?? "Experience the authentic Venda charm in our carefully curated space."} +

+
+ {[...Array(5)].map((_, i) => ( + + ))} +
+
+ + + + + +
+ ) + })} +
+ +
+ + + +
+
+
+ ) +} \ No newline at end of file