Deploy
This commit is contained in:
@@ -0,0 +1,89 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import { useMedusaProducts } from '@/hooks/useMedusaProducts'
|
||||||
|
import Image from 'next/image'
|
||||||
|
import { Card, CardHeader, CardTitle, CardContent, CardFooter } from '@/components/ui/Card'
|
||||||
|
import Button from '@/components/ui/Button'
|
||||||
|
import { Clock, MapPin, Users } from 'lucide-react'
|
||||||
|
|
||||||
|
export default function BespokeSafariExperiencesSection() {
|
||||||
|
const { products: services, isLoading } = useMedusaProducts(8)
|
||||||
|
const fallbackImage = 'https://images.pexels.com/photos/8096930/pexels-photo-8096930.jpeg?auto=compress&cs=tinysrgb&h=350'
|
||||||
|
|
||||||
|
if (isLoading) {
|
||||||
|
return (
|
||||||
|
<section data-vula-section="bespokesafariexperiences" id="safari-experiences" className="py-24 bg-[#17170f]">
|
||||||
|
<div className="max-w-7xl mx-auto px-6 text-center">
|
||||||
|
<p className="text-[#eeeee7]/60">Loading experiences…</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!services || services.length === 0) {
|
||||||
|
return (
|
||||||
|
<section id="safari-experiences" className="py-24 bg-[#17170f]">
|
||||||
|
<div className="max-w-7xl mx-auto px-6 text-center">
|
||||||
|
<p className="text-[#eeeee7]/60">No experiences available at the moment.</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section id="safari-experiences" className="py-24 bg-[#17170f]">
|
||||||
|
<div className="max-w-7xl mx-auto px-6">
|
||||||
|
<div className="text-center mb-16">
|
||||||
|
<div className="inline-flex items-center gap-4 mb-6">
|
||||||
|
<span className="block w-14 h-px bg-[#6b8e23]" />
|
||||||
|
<p className="font-sans uppercase tracking-[0.2em] text-[#6b8e23] text-sm">Bespoke Safari Experiences</p>
|
||||||
|
<span className="block w-14 h-px bg-[#6b8e23]" />
|
||||||
|
</div>
|
||||||
|
<h2 className="font-serif font-light text-4xl md:text-5xl text-[#f5f5dc] leading-tight">
|
||||||
|
Tailored to <span className="italic text-[#6b8e23]">you</span> and the wild
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
|
||||||
|
{services.slice(0, 8).map((service) => {
|
||||||
|
const image = service.thumbnail || fallbackImage
|
||||||
|
const variant = service.variants?.[0]
|
||||||
|
const price = variant?.prices?.[0]
|
||||||
|
const amount = price ? (price.amount / 100).toFixed(2) : null
|
||||||
|
return (
|
||||||
|
<Card key={service.id} className="bg-[#1a1a11] border-[#404030] hover:border-[#6b8e23]/50 transition-all duration-200">
|
||||||
|
<div className="relative h-48 overflow-hidden">
|
||||||
|
<Image
|
||||||
|
src={image}
|
||||||
|
alt={service.title || 'Safari experience'}
|
||||||
|
fill
|
||||||
|
sizes="(max-width: 768px) 100vw, 25vw"
|
||||||
|
className="object-cover"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<CardHeader>
|
||||||
|
<CardTitle className="text-[#f5f5dc] font-serif text-lg">{service.title}</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent>
|
||||||
|
<p className="text-[#eeeee7]/70 text-sm leading-relaxed line-clamp-2">{service.description}</p>
|
||||||
|
{amount && (
|
||||||
|
<p className="mt-3 font-sans text-[#6b8e23] tracking-wider">From R{amount}</p>
|
||||||
|
)}
|
||||||
|
</CardContent>
|
||||||
|
<CardFooter>
|
||||||
|
<Button variant="default" size="sm" className="w-full" href={'/booking/' + service.id}>
|
||||||
|
Book Now
|
||||||
|
</Button>
|
||||||
|
</CardFooter>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
<div className="text-center mt-12">
|
||||||
|
<Button variant="secondary" size="lg" href="/services">
|
||||||
|
View All Experiences
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user