Deploy
This commit is contained in:
@@ -0,0 +1,53 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import { useEmDashContent } from '@/hooks/useEmDashContent'
|
||||||
|
import Image from 'next/image'
|
||||||
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/Card'
|
||||||
|
|
||||||
|
export default function RoyalGallerySection() {
|
||||||
|
const { items, loading } = useEmDashContent('gallery')
|
||||||
|
|
||||||
|
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="royal-gallery" data-vula-section="royalgallery" data-vula-cms="gallery" className="bg-white py-20 px-6">
|
||||||
|
<div className="max-w-7xl mx-auto">
|
||||||
|
<h2 className="text-3xl font-bold text-[#111827] mb-4 text-center">Royal Gallery</h2>
|
||||||
|
<p className="text-[#111827]/70 text-center max-w-2xl mx-auto mb-12">
|
||||||
|
Experience the beauty of KwaNtofontofo through our curated collection
|
||||||
|
</p>
|
||||||
|
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||||
|
{items.map((item) => {
|
||||||
|
const d = item.data as { title?: string; description?: string; image?: string }
|
||||||
|
if (!d.image) return null
|
||||||
|
return (
|
||||||
|
<Card key={item.id} className="group overflow-hidden rounded-2xl border border-neutral-100 bg-white shadow-[var(--shadow-card)] hover:shadow-[var(--shadow-lifted)] hover:-translate-y-0.5 transition-all duration-200 ease-out">
|
||||||
|
<div className="aspect-[4/3] overflow-hidden relative">
|
||||||
|
<Image
|
||||||
|
src={d.image}
|
||||||
|
alt={d.title || 'Gallery image'}
|
||||||
|
fill
|
||||||
|
sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw"
|
||||||
|
className="object-cover group-hover:scale-105 transition-transform duration-500 ease-out"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<CardContent className="p-5">
|
||||||
|
{d.title && <CardTitle className="text-lg font-semibold text-[#111827] mb-1">{d.title}</CardTitle>}
|
||||||
|
{d.description && <p className="text-sm text-[#111827]/60 line-clamp-2">{d.description}</p>}
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user