Deploy
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
'use client'
|
||||
|
||||
import { useEmDashContent } from '@/hooks/useEmDashContent'
|
||||
import Image from 'next/image'
|
||||
import { Quote } from 'lucide-react'
|
||||
|
||||
export default function CustomerStoriesSection() {
|
||||
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="customer-stories" data-vula-section="customerstories" data-vula-cms="posts" className="bg-[#121212] py-20 px-6">
|
||||
<div className="max-w-6xl mx-auto">
|
||||
<h2 className="text-3xl lg:text-4xl font-bold text-[#F5F5F5] mb-4">Real People, Real Fits</h2>
|
||||
<p className="text-[#F5F5F5]/70 mb-12 max-w-2xl">Stories from the streets of Durban and beyond.</p>
|
||||
<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; excerpt?: string; body?: string; author?: string; category?: string; image?: string }
|
||||
return (
|
||||
<div key={item.id} className="rounded-xl overflow-hidden bg-white shadow-md 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">
|
||||
<Image src={d.image} alt={d.title ?? ''} fill className="object-cover" sizes="(max-width: 768px) 100vw, 50vw" />
|
||||
</div>
|
||||
)}
|
||||
<div className="p-5">
|
||||
<span className="inline-block bg-[#4A9EFF]/10 text-[#4A9EFF] text-xs font-semibold px-2 py-0.5 rounded-full mb-2">{d.category ?? 'Community'}</span>
|
||||
<h3 className="text-lg font-semibold text-gray-900 mb-1 line-clamp-2">{d.title}</h3>
|
||||
{d.excerpt && <p className="text-sm text-gray-600 mb-3 line-clamp-3">{d.excerpt}</p>}
|
||||
{d.author && (
|
||||
<p className="text-xs text-gray-400 flex items-center gap-1">
|
||||
<Quote className="w-3 h-3" /> {d.author}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user