Deploy
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
'use client'
|
||||
|
||||
import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
import Button from '@/components/ui/Button'
|
||||
import Badge from '@/components/ui/Badge'
|
||||
import { Card, CardContent, CardFooter, CardHeader, CardTitle, CardDescription } from '@/components/ui/Card'
|
||||
import { useEmDashContent } from '@/hooks/useEmDashContent'
|
||||
|
||||
export default function SpecialsSection() {
|
||||
const { items, loading } = useEmDashContent('campaigns')
|
||||
|
||||
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="specials" data-vula-section="specials" data-vula-cms="campaigns" className="py-20 bg-[#f9f7f4]">
|
||||
<div className="container mx-auto px-4">
|
||||
<h2 className="text-[2rem] font-display font-bold text-[#18181b] text-center mb-4">Seasonal Offers</h2>
|
||||
<p className="text-center text-[#211c0d] mb-12 max-w-2xl mx-auto">Limited-time stays that celebrate the richness of Venda culture and nature.</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; headline?: string; body?: string; cta_text?: string; image?: string }
|
||||
return (
|
||||
<Card key={item.id} className="group overflow-hidden rounded-2xl shadow-[0_4px_20px_rgba(0,0,0,0.08)] hover:shadow-[0_8px_30px_rgba(0,0,0,0.12)] transition-all duration-300">
|
||||
<div className="relative h-48 overflow-hidden">
|
||||
{d.image && (
|
||||
<Image
|
||||
src={d.image}
|
||||
alt={d.headline || d.title || ''}
|
||||
fill
|
||||
sizes="(max-width: 768px) 100vw, 50vw"
|
||||
className="object-cover group-hover:scale-105 transition-transform duration-500"
|
||||
/>
|
||||
)}
|
||||
<div className="absolute top-3 left-3 flex gap-2">
|
||||
<Badge variant="success" className="bg-[#16a34a] text-white border-0">Limited</Badge>
|
||||
<Badge className="bg-[#d4af37] text-white border-0">Seasonal</Badge>
|
||||
</div>
|
||||
</div>
|
||||
<CardHeader>
|
||||
<CardTitle className="text-xl font-semibold text-[#18181b]">
|
||||
{d.headline || d.title}
|
||||
</CardTitle>
|
||||
<CardDescription className="text-[#211c0d] font-serif italic">
|
||||
{d.body?.substring(0, 120)}{d.body && d.body.length > 120 ? '...' : ''}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardFooter className="pt-0">
|
||||
{d.cta_text ? (
|
||||
<Link href="/booking">
|
||||
<Button variant="default" className="bg-[#d4af37] hover:bg-[#b8962e] text-white w-full">
|
||||
{d.cta_text}
|
||||
</Button>
|
||||
</Link>
|
||||
) : (
|
||||
<Link href="/booking">
|
||||
<Button variant="outline" className="border-[#d4af37] text-[#d4af37] hover:bg-[#d4af37]/10 w-full">
|
||||
Book Now
|
||||
</Button>
|
||||
</Link>
|
||||
)}
|
||||
</CardFooter>
|
||||
</Card>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user