Deploy
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
'use client'
|
||||
import Image from 'next/image'
|
||||
import { useVulaContent } from '@/hooks/useVulaContent'
|
||||
|
||||
export default function IkayaStorySection() {
|
||||
const { items, loading } = useVulaContent('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="ikayastory" data-vula-section="ikayastory" data-vula-cms="posts" className="py-16 bg-gray-50">
|
||||
<div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div className="text-center mb-10">
|
||||
<h2 className="text-3xl font-bold text-gray-900">Latest Posts</h2>
|
||||
</div>
|
||||
<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; author?: string; category?: string; image?: string }
|
||||
return (
|
||||
<article key={item.id} className="bg-white rounded-xl overflow-hidden shadow-sm hover:shadow-md transition-shadow">
|
||||
{d.image && <div className="relative h-48"><Image src={d.image} alt={d.title || ''} fill className="object-cover" /></div>}
|
||||
<div className="p-6">
|
||||
{d.category && <span className="text-xs font-semibold uppercase tracking-wide text-blue-600">{d.category}</span>}
|
||||
{d.title && <h3 className="mt-2 text-lg font-bold text-gray-900 leading-snug">{d.title}</h3>}
|
||||
{d.excerpt && <p className="mt-2 text-gray-600 text-sm line-clamp-3">{d.excerpt}</p>}
|
||||
{d.author && <p className="mt-4 text-xs text-gray-400">By {d.author}</p>}
|
||||
</div>
|
||||
</article>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user