Deploy
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
'use client'
|
||||
|
||||
import { useEmDashContent } from "@/hooks/useEmDashContent"
|
||||
import Image from "next/image"
|
||||
import Link from "next/link"
|
||||
import { Card, CardContent } from "@/components/ui/Card"
|
||||
import Badge from "@/components/ui/Badge"
|
||||
import Button from "@/components/ui/Button"
|
||||
|
||||
export default function SpecialsSection() {
|
||||
const { items, loading } = useEmDashContent("promotions")
|
||||
// Hooks must be declared before any early returns
|
||||
|
||||
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="promotions"
|
||||
className="py-20 bg-white"
|
||||
>
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div className="text-center mb-12">
|
||||
<p className="text-sm uppercase tracking-widest text-[#2563eb] mb-2">
|
||||
Limited Offers
|
||||
</p>
|
||||
<h2 className="text-4xl font-bold text-[#21140d] mb-4">
|
||||
Specials worth the trip
|
||||
</h2>
|
||||
<p className="text-[#21140d]/70 italic max-w-2xl mx-auto">
|
||||
Exclusive packages and seasonal deals crafted for unforgettable stays.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<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
|
||||
image?: string
|
||||
}
|
||||
return (
|
||||
<Card key={item.id} className="overflow-hidden rounded-2xl shadow-2xl border-0 group">
|
||||
<div className="relative aspect-video overflow-hidden">
|
||||
{d.image && (
|
||||
<Image
|
||||
src={d.image}
|
||||
alt={d.title || "Promotion"}
|
||||
fill
|
||||
sizes="(max-width: 768px) 100vw, 33vw"
|
||||
className="object-cover transition-transform duration-500 ease-out group-hover:scale-105"
|
||||
/>
|
||||
)}
|
||||
{d.price && (
|
||||
<Badge variant="default" className="absolute top-3 right-3 text-sm font-bold shadow-lg">
|
||||
From {d.price}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
<CardContent className="p-6">
|
||||
<h3 className="text-xl font-bold text-[#21140d] mb-2">{d.title}</h3>
|
||||
<p className="text-[#21140d]/70 text-sm italic mb-4">
|
||||
{d.description}
|
||||
</p>
|
||||
<Link href="/booking">
|
||||
<Button variant="default" className="w-full">
|
||||
Book Now
|
||||
</Button>
|
||||
</Link>
|
||||
</CardContent>
|
||||
</Card>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user