Deploy
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
'use client'
|
||||
|
||||
import { useEmDashContent } from '@/hooks/useEmDashContent'
|
||||
import Image from 'next/image'
|
||||
import Button from '@/components/ui/Button'
|
||||
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@/components/ui/Card'
|
||||
|
||||
export default function RegalExclusiveOffersSection() {
|
||||
const { items, loading } = useEmDashContent('offers')
|
||||
|
||||
if (loading) return <div className="flex justify-center py-16"><div className="w-8 h-8 rounded-full border-2 border-[#d4af37] border-t-transparent animate-spin" /></div>
|
||||
if (items.length === 0) return null
|
||||
|
||||
return (
|
||||
<section id="regal-exclusive-offers" data-vula-section="regalexclusiveoffers" data-vula-cms="offers" className="py-20 bg-white">
|
||||
<div className="container mx-auto px-4">
|
||||
<h2 className="text-3xl font-bold text-center text-[#111827] mb-4">Regal Exclusive Offers</h2>
|
||||
<p className="text-center text-[#8b5a3c] mb-12 max-w-2xl mx-auto">
|
||||
Special packages and seasonal deals crafted for our valued guests
|
||||
</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?: string; duration?: string; valid_until?: string; image?: string }
|
||||
return (
|
||||
<Card key={item.id} className="group overflow-hidden hover:shadow-[var(--shadow-lifted)] hover:-translate-y-0.5 transition-all duration-200 ease-out border border-[#e5e7eb] bg-white rounded-xl">
|
||||
{d.image && (
|
||||
<div className="relative aspect-video overflow-hidden">
|
||||
<Image src={d.image} alt={d.title || 'Offer image'} fill className="object-cover group-hover:scale-105 transition-transform duration-500 ease-out" sizes="(max-width: 768px) 100vw, 50vw" />
|
||||
</div>
|
||||
)}
|
||||
<CardHeader className="pb-2">
|
||||
<CardTitle className="text-[#8b5a3c] text-xl">{d.title}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="text-[#111827] space-y-2">
|
||||
<p className="text-sm leading-relaxed">{d.description}</p>
|
||||
{d.price && <p className="text-lg font-bold text-[#16a34a]">R {d.price}</p>}
|
||||
{d.duration && <p className="text-xs text-[#8b5a3c]">Duration: {d.duration}</p>}
|
||||
{d.valid_until && (
|
||||
<p className="text-xs text-[#8b5a3c]">Valid until: {new Date(d.valid_until).toLocaleDateString("en-ZA", { year: "numeric", month: "long", day: "numeric" })}</p>
|
||||
)}
|
||||
</CardContent>
|
||||
<CardFooter className="pt-0">
|
||||
<Button variant="default" className="w-full bg-[#d4af37] text-white hover:opacity-90">Book This Offer</Button>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user