diff --git a/src/components/sections/MaasaiSuitesRoomsSection.tsx b/src/components/sections/MaasaiSuitesRoomsSection.tsx new file mode 100644 index 0000000..bb21417 --- /dev/null +++ b/src/components/sections/MaasaiSuitesRoomsSection.tsx @@ -0,0 +1,88 @@ +'use client' + +import { useMedusaProducts } from "@/hooks/useMedusaProducts" +import { Card } from "@/components/ui/Card" +import Button from "@/components/ui/Button" +import Image from "next/image" +import Link from "next/link" + +const CURRENCY_SYMBOLS: Record = { kes: "KSh", usd: "$", eur: "€", gbp: "£" } +const formatPrice = (amount: number, code?: string) => { + const sym = CURRENCY_SYMBOLS[(code ?? "").toLowerCase()] ?? (code?.toUpperCase() ?? "") + return `${sym}${(amount / 100).toLocaleString()}` +} + +export default function MaasaiSuitesRoomsSection() { + const { products: rooms, isLoading } = useMedusaProducts(6) + + if (isLoading) { + return ( +
+
+
+
+
+ {[1,2,3].map(i =>
)} +
+
+
+
+ ) + } + + return ( +
+
+

+ Handcrafted Suites with a View +

+

+ Each room weaves Maasai artisanry with modern comfort — overlooking the endless savannah. +

+
+ {rooms?.map((room) => { + const price = room.variants?.[0]?.prices?.[0] + return ( + +
+ {room.title} +
+
+

{room.title}

+

+ {room.description?.substring(0, 120)}... +

+
+ {price && ( + + {formatPrice(price.amount, price.currency_code)} /night + + )} + + + +
+
+
+ ) + })} +
+
+ + + +
+
+
+ ) +} \ No newline at end of file