diff --git a/src/components/sections/KwaNtofontofoRoomsSection.tsx b/src/components/sections/KwaNtofontofoRoomsSection.tsx new file mode 100644 index 0000000..5aa970d --- /dev/null +++ b/src/components/sections/KwaNtofontofoRoomsSection.tsx @@ -0,0 +1,93 @@ +'use client' + +import { useMedusaProducts } from "@/hooks/useMedusaProducts" +import Image from "next/image" +import Link from "next/link" +import { Card, 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: "£", kes: "KSh", ngn: "₦" } +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/15640157/pexels-photo-15640157.jpeg?auto=compress&cs=tinysrgb&h=350", + "https://images.pexels.com/photos/37930119/pexels-photo-37930119.jpeg?auto=compress&cs=tinysrgb&h=350", + "https://images.pexels.com/photos/29893445/pexels-photo-29893445.jpeg?auto=compress&cs=tinysrgb&h=350", + "https://images.pexels.com/photos/34515222/pexels-photo-34515222.jpeg?auto=compress&cs=tinysrgb&h=350", + "https://images.pexels.com/photos/34515222/pexels-photo-34515222.jpeg?auto=compress&cs=tinysrgb&h=350", + "https://images.pexels.com/photos/34515222/pexels-photo-34515222.jpeg?auto=compress&cs=tinysrgb&h=350", +] + +export default function KwaNtofontofoRoomsSection() { + const { products: rooms, isLoading } = useMedusaProducts(6) + + return ( +
+
+

+ Our Luxury Rooms +

+

+ Each room is uniquely themed, air-conditioned with en-suite facilities, + DStv, and a personal touch that makes you feel like royalty. +

+ + {isLoading && ( +
Loading rooms...
+ )} + + {!isLoading && rooms && rooms.length > 0 && ( +
+ {rooms.map((room, index) => { + const price = room.variants?.[0]?.prices?.[0] + return ( + +
+ {room.title +
+ +

{room.title}

+

{room.description}

+
+ En-suite + Air-conditioned + DStv +
+
+ {price && ( + + {formatPrice(price.amount, price.currency_code)} / night + + )} + + + +
+
+
+ ) + })} +
+ )} + + {!isLoading && (!rooms || rooms.length === 0) && ( +
+

No rooms available at the moment. Please check back later.

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