This commit is contained in:
Vula Builder
2026-06-23 08:47:44 +00:00
parent f1ee9bfbcb
commit e88cee9e7f
@@ -0,0 +1,84 @@
'use client'
import { useMedusaProducts } from '@/hooks/useMedusaProducts'
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '@/components/ui/Card'
import Button from '@/components/ui/Button'
import Link from 'next/link'
import Image from 'next/image'
import { BedDouble, Snowflake, Tv, Wifi } from 'lucide-react'
export default function ThemedRegalSuitesSection() {
const { products: rooms, isLoading, error } = useMedusaProducts(6)
if (isLoading) {
return (
<section data-vula-section="themedregalsuites" id="themed-suites" className="py-20 bg-white">
<div className="container mx-auto px-4 text-center">
<p className="text-lg text-gray-500">Loading our royal suites...</p>
</div>
</section>
)
}
if (error || !rooms) {
return (
<section id="themed-suites" className="py-20 bg-white">
<div className="container mx-auto px-4 text-center">
<p className="text-lg text-red-500">Unable to load suites. Please try again later.</p>
</div>
</section>
)
}
const formatPrice = (amount: number, code?: string) => {
const sym = 'R'
return `${sym}${(amount / 100).toFixed(2)}`
}
return (
<section id="themed-suites" className="py-20 bg-neutral-50">
<div className="container mx-auto px-4">
<div className="text-center mb-12">
<h2 className="text-3xl md:text-4xl font-bold text-gray-900 mb-4">Themed Regal Suites</h2>
<p className="text-gray-600 max-w-2xl mx-auto">
Each of our six individually themed, fully air-conditioned luxury suites offers en-suite bathroom, TV with DStv, and a private sanctuary feel. Choose the room that speaks to your soul.
</p>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
{rooms.map((room) => {
const price = room.variants?.[0]?.prices?.[0]
return (
<Card key={room.id} className="hover:shadow-[var(--shadow-lifted)] hover:-translate-y-0.5 transition-all duration-200 ease-out">
<div className="relative aspect-video overflow-hidden rounded-t-xl">
{room.thumbnail ? (
<Image src={room.thumbnail} alt={room.title} fill sizes="(max-width: 768px) 100vw, 50vw" className="object-cover" />
) : (
<div className="w-full h-full bg-gray-200 flex items-center justify-center text-gray-400">
<BedDouble size={48} />
</div>
)}
</div>
<CardHeader>
<CardTitle className="text-xl font-semibold text-gray-900">{room.title}</CardTitle>
<CardDescription className="text-gray-500 line-clamp-2">{room.description}</CardDescription>
</CardHeader>
<CardContent className="flex items-center gap-2 text-sm text-gray-500">
<Snowflake size={16} /> <span>Air-conditioned</span>
<Tv size={16} /> <span>DStv</span>
<Wifi size={16} /> <span>Wi-Fi</span>
</CardContent>
<CardFooter className="flex items-center justify-between">
{price && (
<span className="text-[#d4af37] font-bold text-lg">{formatPrice(price.amount, price.currency_code)}</span>
)}
<Link href={`/booking/${room.id}`}>
<Button variant="default" size="sm" className="bg-[#d4af37] hover:bg-[#b8962f] text-white">Book Now</Button>
</Link>
</CardFooter>
</Card>
)
})}
</div>
</div>
</section>
)
}