Deploy
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
'use client'
|
||||
|
||||
import { useEmDashContent } from '@/hooks/useEmDashContent'
|
||||
import Image from 'next/image'
|
||||
import { ArrowRight } from 'lucide-react'
|
||||
|
||||
export default function ImveloInsightsSection() {
|
||||
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-current border-t-transparent animate-spin" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
if (items.length === 0) return null
|
||||
|
||||
return (
|
||||
<section
|
||||
id="stories"
|
||||
data-vula-section="imveloinsights"
|
||||
data-vula-cms="posts"
|
||||
className="py-16 bg-white"
|
||||
>
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<h2 className="text-3xl font-bold text-[#d4af37] text-center mb-4">Imvelo Insights</h2>
|
||||
<p className="text-center text-neutral-600 mb-12 max-w-2xl mx-auto">
|
||||
Stories from our journal — wildlife encounters, braai recipes, and local gems in Pietermaritzburg.
|
||||
</p>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||
{items.slice(0, 3).map((item) => {
|
||||
const d = item.data as { title?: string; excerpt?: string; body?: string; author?: string; category?: string; image?: string }
|
||||
const imageUrl = d.image || 'https://images.pexels.com/photos/37238864/pexels-photo-37238864.jpeg?auto=compress&cs=tinysrgb&h=350'
|
||||
return (
|
||||
<article key={item.id} className="rounded-xl border border-neutral-100 bg-white shadow-[var(--shadow-card)] hover:shadow-[var(--shadow-lifted)] hover:-translate-y-0.5 transition-all duration-200 ease-out overflow-hidden">
|
||||
<div className="aspect-video relative overflow-hidden">
|
||||
<Image src={imageUrl} alt={d.title || 'Journal post'} fill sizes="(max-width: 768px) 100vw, 50vw" className="object-cover hover:scale-105 transition-transform duration-500 ease-out" />
|
||||
</div>
|
||||
<div className="p-5">
|
||||
{d.category && (
|
||||
<span className="text-xs uppercase tracking-widest text-[#2563eb] font-semibold">{d.category}</span>
|
||||
)}
|
||||
<h3 className="mt-2 text-lg font-bold text-[#111827]">{d.title || 'Untitled'}</h3>
|
||||
<p className="mt-2 text-neutral-600 text-sm line-clamp-3">{d.excerpt || d.body?.slice(0, 150) || ''}</p>
|
||||
<div className="mt-4 flex items-center justify-between">
|
||||
{d.author && <span className="text-xs text-neutral-500">By {d.author}</span>}
|
||||
<span className="inline-flex items-center text-[#d4af37] font-medium text-sm hover:underline cursor-pointer">
|
||||
Read more <ArrowRight className="ml-1 w-3 h-3" />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user