diff --git a/src/components/sections/ThemedEnSuiteSection.tsx b/src/components/sections/ThemedEnSuiteSection.tsx new file mode 100644 index 0000000..9378243 --- /dev/null +++ b/src/components/sections/ThemedEnSuiteSection.tsx @@ -0,0 +1,122 @@ +'use client' + +import { useState } from "react" +import { useMedusaProducts } from "@/hooks/useMedusaProducts" +import Button from "@/components/ui/Button" +import Badge from "@/components/ui/Badge" +import { Card, CardHeader, CardTitle, CardContent, CardFooter } from "@/components/ui/Card" +import { Shield, Tv, Wifi, Wind } from 'lucide-react' + +export default function ThemedEnSuiteSection() { + const { products: rooms, isLoading, error } = useMedusaProducts({ limit: 8 }) + + if (isLoading) { + return ( + + + + + + ) + } + + if (error) { + return ( + + + Unable to load rooms. Please try again later. + + + ) + } + + const displayRooms = (rooms ?? []).slice(0, 8) + + if (displayRooms.length === 0) { + return ( + + + No rooms currently available. Check back soon. + + + ) + } + + return ( + + + + + Themed En-Suite Rooms + + + Each room is uniquely styled with its own personality — air-conditioned, with DStv and premium comfort. + + + + + {displayRooms.map((room) => { + const price = room.variants?.[0]?.prices?.[0] + const formattedPrice = price + ? `R${(price.amount / 100).toFixed(2)}` + : "" + + return ( + + + {room.thumbnail ? ( + + ) : ( + + + + )} + + + {room.title} + + + {room.description} + + + Air-con + + + DStv + + + + + {formattedPrice && ( + {formattedPrice} / night + )} + + Book Now + + + + ) + })} + + + + + View All Rooms + + + + + ) +} \ No newline at end of file
Unable to load rooms. Please try again later.
No rooms currently available. Check back soon.
+ Each room is uniquely styled with its own personality — air-conditioned, with DStv and premium comfort. +
{room.description}