This commit is contained in:
Vula Builder
2026-07-28 09:03:29 +00:00
parent 602fcdc10d
commit cddc430c5f
@@ -0,0 +1,40 @@
'use client'
import { useState } from 'react';
import { useVulaContent } from '@/hooks/useVulaContent'
import Image from 'next/image'
export default function GallerySection() {
const { items, loading } = useVulaContent('gallery')
const [active, setActive] = useState(0) // hook before guard
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="gallery" data-vula-section="gallery" data-vula-cms="gallery" className="py-20 px-4 bg-white">
<div className="max-w-6xl mx-auto">
<h2 className="text-3xl font-semibold text-[#2c331f] text-center mb-12">
<span className="text-[#6b8e23]">Visual</span> journey
</h2>
<div className="columns-2 md:columns-3 gap-4 space-y-4">
{items.map((item) => {
const d = item.data as { title?: string; description?: string; image?: string }
return (
<div key={item.id} className="break-inside-avoid rounded-[28px] overflow-hidden shadow-lg hover:shadow-xl transition-shadow duration-200">
{d.image && (
<div className="relative">
<Image src={d.image} alt={d.title ?? ''} width={400} height={400} className="object-cover w-full h-auto" />
{(d.title || d.description) && (
<div className="absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/50 to-transparent p-4">
{d.title && <p className="text-white font-semibold text-sm">{d.title}</p>}
{d.description && <p className="text-white/80 text-xs">{d.description}</p>}
</div>
)}
</div>
)}
</div>
)
})}
</div>
</div>
</section>
)
}