Deploy
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
'use client'
|
||||
import Image from 'next/image'
|
||||
import { useVulaContent } from '@/hooks/useVulaContent'
|
||||
|
||||
export default function FeaturedProductsSection() {
|
||||
const { items, loading } = useVulaContent('featured_products')
|
||||
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="featuredproducts" data-vula-section="featuredproducts" data-vula-cms="featured_products" className="py-16 bg-white">
|
||||
<div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{items.map((item) => {
|
||||
const d = item.data as Record<string, string | undefined>
|
||||
const imageUrl = d.image
|
||||
const title = d.title || d.name || d.headline
|
||||
const body = d.body || d.description || d.excerpt || d.bio
|
||||
return (
|
||||
<div key={item.id} className="bg-white rounded-xl overflow-hidden shadow-md hover:shadow-lg transition-shadow border border-gray-100">
|
||||
{imageUrl && <div className="relative h-48"><Image src={imageUrl} alt={title || ''} fill className="object-cover" /></div>}
|
||||
<div className="p-5">
|
||||
{title && <h3 className="font-semibold text-gray-900 mb-2">{title}</h3>}
|
||||
{body && <p className="text-gray-600 text-sm">{body}</p>}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user