This commit is contained in:
Vula Builder
2026-07-25 11:17:58 +00:00
parent 0ec90c4293
commit aa97309d4b
@@ -0,0 +1,95 @@
'use client'
import { useEmDashContent } from '@/hooks/useEmDashContent'
import Image from 'next/image'
import { Quote } from 'lucide-react'
export default function GuestReflectionsSection() {
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-[#C0392B] border-t-transparent animate-spin" />
</div>
)
}
// Filter for review-tagged posts
const reviews = items.filter((item) => {
const d = item.data as { category?: string }
return d.category?.toLowerCase().includes('review')
})
if (reviews.length === 0) return null
return (
<section
id="guest-reflections"
data-vula-section="guestreflections"
data-vula-cms="posts"
className="py-20 bg-[#FDF6EC]"
>
<div className="max-w-7xl mx-auto px-4">
<div className="text-center mb-12">
<span className="text-[#E67E22] text-sm font-semibold tracking-widest uppercase">
Guest Voices
</span>
<h2 className="text-4xl font-bold text-[#2C1810] mt-2">
Guest Reflections
</h2>
<p className="text-[#2C1810]/70 max-w-2xl mx-auto mt-4">
Honest stories from travellers who stayed with us
</p>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
{reviews.slice(0, 6).map((item) => {
const d = item.data as {
title?: string
excerpt?: string
body?: string
author?: string
category?: string
image?: string
}
return (
<div
key={item.id}
className="rounded-xl overflow-hidden bg-white shadow-lg hover:shadow-xl transition-shadow duration-200"
>
<div className="p-5">
<Quote className="w-8 h-8 text-[#E67E22] mb-3" />
<p className="text-[#2C1810]/80 text-sm leading-relaxed italic">
&ldquo;{d.excerpt || (d.body ? d.body.substring(0, 150) + '...' : '')}&rdquo;
</p>
<div className="mt-4 flex items-center gap-3">
{d.image && (
<div className="relative w-10 h-10 rounded-full overflow-hidden flex-shrink-0">
<Image
src={d.image}
alt={d.author ?? 'Guest'}
fill
className="object-cover"
sizes="40px"
/>
</div>
)}
<div>
<p className="font-semibold text-[#2C1810] text-sm">
{d.author || 'Anonymous Guest'}
</p>
<p className="text-[#2C1810]/50 text-xs">
{d.title}
</p>
</div>
</div>
</div>
</div>
)
})}
</div>
</div>
</section>
)
}