This commit is contained in:
Vula Builder
2026-07-25 11:17:59 +00:00
parent b53b37e14d
commit 4639fc0cc4
@@ -0,0 +1,104 @@
'use client'
import { useEmDashContent } from '@/hooks/useEmDashContent'
import Image from 'next/image'
import Link from 'next/link'
import { ArrowRight } from 'lucide-react'
export default function StoriesOfTheLandSection() {
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 blog-tagged posts
const blogs = items.filter((item) => {
const d = item.data as { category?: string }
return d.category?.toLowerCase().includes('blog')
})
if (blogs.length === 0) return null
return (
<section
id="stories-of-the-land"
data-vula-section="storiesoftheland"
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">
From the Savanna
</span>
<h2 className="text-4xl font-bold text-[#2C1810] mt-2">
Stories of the Land
</h2>
<p className="text-[#2C1810]/70 max-w-2xl mx-auto mt-4">
Tales of nature, culture, and discovery from the heart of Kenya
</p>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
{blogs.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 group"
>
{d.image && (
<div className="relative h-48 w-full">
<Image
src={d.image}
alt={d.title ?? 'Story image'}
fill
className="object-cover group-hover:scale-105 transition-transform duration-500 ease-out"
sizes="(max-width: 768px) 100vw, (max-width: 1024px) 50vw, 33vw"
/>
</div>
)}
<div className="p-5">
<div className="flex items-center gap-2 mb-2">
<span className="text-[#C0392B] text-xs font-semibold uppercase tracking-wider">
{d.category}
</span>
{d.author && (
<span className="text-[#2C1810]/50 text-xs">
by {d.author}
</span>
)}
</div>
<h3 className="text-lg font-semibold text-[#2C1810]">
{d.title}
</h3>
<p className="text-[#2C1810]/70 text-sm mt-2 leading-relaxed line-clamp-3">
{d.excerpt || (d.body ? d.body.substring(0, 120) : '')}
</p>
<Link
href="/booking"
className="inline-flex items-center gap-1 mt-4 text-[#E67E22] font-semibold text-sm hover:text-[#c96b1c] transition-colors"
>
Read More <ArrowRight className="w-4 h-4" />
</Link>
</div>
</div>
)
})}
</div>
</div>
</section>
)
}