This commit is contained in:
Vula Builder
2026-06-23 08:47:21 +00:00
parent 72949b365d
commit 6e330df37c
@@ -0,0 +1,68 @@
'use client'
import { useEmDashContent } from '@/hooks/useEmDashContent'
import Image from 'next/image'
import Button from '@/components/ui/Button'
import { Card, CardContent, CardHeader, CardTitle, CardFooter } from '@/components/ui/Card'
import { Tag } from 'lucide-react'
export default function ExclusivePromotionsSection() {
const { items, loading } = useEmDashContent('promotions')
if (loading) {
return (
<div className="flex justify-center py-16">
<div className="w-8 h-8 rounded-full border-2 border-current border-t-transparent animate-spin" />
</div>
)
}
if (items.length === 0) return null
return (
<section id="exclusive-promotions" data-vula-section="exclusivepromotions" data-vula-cms="promotions" className="bg-neutral-50 py-20 px-6">
<div className="max-w-7xl mx-auto">
<h2 className="text-3xl font-bold text-[#111827] mb-4 text-center">Exclusive Promotions</h2>
<p className="text-[#111827]/70 text-center max-w-2xl mx-auto mb-12">
Limitedtime offers crafted for your royal stay
</p>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
{items.map((item) => {
const d = item.data as { title?: string; description?: string; price?: number; image?: string }
if (!d.image) return null
const priceDisplay = d.price ? `R${(d.price / 100).toFixed(2)}` : null
return (
<Card key={item.id} className="rounded-2xl border border-neutral-100 bg-white shadow-[var(--shadow-card)] hover:shadow-[var(--shadow-lifted)] hover:-translate-y-0.5 transition-all duration-200 ease-out overflow-hidden">
<div className="aspect-video overflow-hidden relative">
<Image
src={d.image}
alt={d.title || 'Promotion'}
fill
sizes="(max-width: 768px) 100vw, (max-width: 1024px) 50vw, 33vw"
className="object-cover"
/>
</div>
<CardHeader className="p-5 pb-2">
<div className="flex items-center gap-2 mb-1">
<Tag className="w-4 h-4 text-[#16a34a]" />
<span className="text-xs font-medium text-[#16a34a] uppercase tracking-wide">Special Offer</span>
</div>
{d.title && <CardTitle className="text-xl font-semibold text-[#111827]">{d.title}</CardTitle>}
</CardHeader>
<CardContent className="px-5 pb-2">
{d.description && <p className="text-sm text-[#111827]/70 line-clamp-2 mb-2">{d.description}</p>}
{priceDisplay && <p className="text-lg font-bold text-[#8b5a3c]">{priceDisplay}</p>}
</CardContent>
<CardFooter className="p-5 pt-2">
<Button variant="default" size="sm" className="bg-[#d4af37] hover:bg-[#d4af37]/90 text-white">
Book Now
</Button>
</CardFooter>
</Card>
)
})}
</div>
</div>
</section>
)
}