Deploy
This commit is contained in:
@@ -0,0 +1,45 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import { useEmDashContent } from '@/hooks/useEmDashContent'
|
||||||
|
|
||||||
|
export default function TestimonialsSection() {
|
||||||
|
const { items, loading } = useEmDashContent('posts')
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
// Use only first 3 items for testimonial cards
|
||||||
|
const featured = items.slice(0, 3)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section id="testimonials" data-vula-section="testimonials" data-vula-cms="posts" className="bg-white py-20 px-4">
|
||||||
|
<div className="max-w-4xl mx-auto">
|
||||||
|
<h2 className="text-3xl font-bold text-[#1B3A1F] mb-10 text-center">Cosa Dicono i Nostri Ospiti</h2>
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
|
||||||
|
{featured.map((item) => {
|
||||||
|
const d = item.data as { title?: string; excerpt?: string; author?: string; category?: string; body?: string }
|
||||||
|
const quote = d.excerpt || d.body?.slice(0, 100) || ''
|
||||||
|
return (
|
||||||
|
<div key={item.id} className="rounded-xl border border-[#8BC34A]/20 bg-[#F1F8E9] p-6 shadow-[var(--shadow-card)] hover:shadow-[var(--shadow-lifted)] transition-all duration-200 ease-out">
|
||||||
|
{/* Leaf motif */}
|
||||||
|
<div className="text-[#8BC34A] text-2xl mb-3">❦</div>
|
||||||
|
<p className="text-sm text-[#1B3A1F]/80 mb-4 leading-relaxed">“{quote}”</p>
|
||||||
|
<div className="border-t border-[#8BC34A]/30 pt-3 flex items-center justify-between">
|
||||||
|
<p className="text-sm font-semibold text-[#1B3A1F]">{d.author || 'Ospite'}</p>
|
||||||
|
{d.category && <span className="text-xs text-[#4CAF50]">{d.category}</span>}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user