This commit is contained in:
Vula Builder
2026-07-28 13:27:27 +00:00
parent 5914c722fd
commit 1644cdda72
@@ -0,0 +1,46 @@
'use client'
import { useVulaContent } from '@/hooks/useVulaContent'
import { Card, CardHeader, CardTitle, CardContent, CardFooter } from '@/components/ui/Card'
import Badge from '@/components/ui/Badge'
import Image from 'next/image'
export default function JournalSection() {
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="journal" data-vula-section="journal" data-vula-cms="posts" className="py-24 bg-[#0f0f17]">
<div className="container mx-auto px-4">
<h2 className="text-3xl font-light text-[#e7e7ee] tracking-wide uppercase text-center mb-12">Journal</h2>
<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 (
<Card key={item.id} className="bg-[#18181b] border border-[#303040] flex flex-col">
{d.image && (
<div className="relative aspect-video overflow-hidden rounded-t-lg">
<Image src={d.image} alt={d.title ?? ''} fill sizes="(max-width: 768px) 100vw, 33vw" className="object-cover" />
</div>
)}
<CardHeader>
{d.category && <Badge variant="secondary" className="w-fit mb-2 text-xs">{d.category}</Badge>}
<CardTitle className="text-[#e7e7ee] font-light text-lg">{d.title}</CardTitle>
</CardHeader>
<CardContent className="flex-1">
<p className="text-[#e7e7ee]/70 text-sm leading-relaxed">{d.excerpt}</p>
</CardContent>
<CardFooter className="border-t border-[#303040] pt-3">
{d.author && <span className="text-[#c0c0c0] text-xs uppercase tracking-wider">{d.author}</span>}
</CardFooter>
</Card>
)
})}
</div>
</div>
</section>
)
}