Deploy
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
'use client'
|
||||||
|
import { useEmDashContent } from '@/hooks/useEmDashContent'
|
||||||
|
import { Card, CardHeader, CardTitle, CardContent, CardFooter } from '@/components/ui/Card'
|
||||||
|
import Image from 'next/image'
|
||||||
|
import Button from '@/components/ui/Button'
|
||||||
|
|
||||||
|
export default function PromotionsSection() {
|
||||||
|
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="promotions" data-vula-section="promotions" data-vula-cms="promotions" className="py-20 lg:py-28 bg-neutral-50">
|
||||||
|
<div className="container mx-auto px-4">
|
||||||
|
<h2 className="text-3xl lg:text-4xl font-semibold tracking-tight text-center mb-12">Special Promotions</h2>
|
||||||
|
<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 }
|
||||||
|
return (
|
||||||
|
<Card key={item.id} className="rounded-xl border border-neutral-100 shadow-[var(--shadow-card)] hover:shadow-[var(--shadow-lifted)] hover:-translate-y-0.5 transition-all duration-200 ease-out">
|
||||||
|
{d.image && (
|
||||||
|
<div className="aspect-video relative overflow-hidden rounded-t-xl">
|
||||||
|
<Image src={d.image} alt={d.title || ''} fill sizes="(max-width: 768px) 100vw, 50vw" className="object-cover hover:scale-105 transition-transform duration-500 ease-out" />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<CardHeader>
|
||||||
|
<CardTitle className="text-xl font-semibold text-[#36454F]">{d.title}</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent>
|
||||||
|
<p className="text-base leading-relaxed text-neutral-600">{d.description}</p>
|
||||||
|
</CardContent>
|
||||||
|
<CardFooter className="flex items-center justify-between">
|
||||||
|
<p className="text-lg font-bold text-[#d4af37]">{d.price ? `R${Number(d.price).toFixed(0)}` : 'Contact us'}</p>
|
||||||
|
<Button variant="default" size="sm">Book Now</Button>
|
||||||
|
</CardFooter>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user