Deploy
This commit is contained in:
@@ -0,0 +1,54 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import { useEmDashContent } from '@/hooks/useEmDashContent'
|
||||||
|
import Image from 'next/image'
|
||||||
|
import { Leaf } from 'lucide-react'
|
||||||
|
import Button from '@/components/ui/Button'
|
||||||
|
|
||||||
|
export default function CampaignsSection() {
|
||||||
|
const { items, loading } = useEmDashContent('campaigns')
|
||||||
|
|
||||||
|
if (loading) {
|
||||||
|
return (
|
||||||
|
<div className="flex justify-center py-16">
|
||||||
|
<div className="w-8 h-8 rounded-full border-2 border-[#4CAF50] border-t-transparent animate-spin" />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (items.length === 0) return null
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section id="specials" data-vula-section="campaigns" data-vula-cms="campaigns" className="bg-[#F1F8E9] py-20 px-4">
|
||||||
|
<div className="max-w-6xl mx-auto">
|
||||||
|
<h2 className="text-3xl font-bold text-[#1B3A1F] mb-8 text-center">Campagne Stagionali</h2>
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||||
|
{items.map((item) => {
|
||||||
|
const d = item.data as { title?: string; headline?: string; body?: string; cta_text?: string; image?: string }
|
||||||
|
return (
|
||||||
|
<div key={item.id} className="rounded-xl overflow-hidden bg-white shadow-[var(--shadow-card)] hover:shadow-[var(--shadow-lifted)] hover:-translate-y-0.5 transition-all duration-200 ease-out">
|
||||||
|
{d.image && (
|
||||||
|
<div className="relative h-48 w-full overflow-hidden">
|
||||||
|
<Image src={d.image} alt={d.title || d.headline || ''} fill className="object-cover hover:scale-105 transition-transform duration-500 ease-out" sizes="(max-width: 768px) 100vw, 50vw" />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<div className="p-5">
|
||||||
|
<div className="flex items-center gap-2 mb-2">
|
||||||
|
<Leaf className="w-5 h-5 text-[#4CAF50]" />
|
||||||
|
<h3 className="text-lg font-semibold text-[#1B3A1F]">{d.title || d.headline}</h3>
|
||||||
|
</div>
|
||||||
|
<p className="text-[#1B3A1F]/70 text-sm mb-4">{d.body}</p>
|
||||||
|
{d.cta_text && (
|
||||||
|
<Button variant="secondary" size="sm" className="bg-[#4CAF50] text-white hover:bg-[#2E7D32]">
|
||||||
|
{d.cta_text}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user