Deploy
This commit is contained in:
@@ -0,0 +1,84 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import { useEmDashContent } from '@/hooks/useEmDashContent'
|
||||||
|
import Image from 'next/image'
|
||||||
|
import Badge from '@/components/ui/Badge'
|
||||||
|
|
||||||
|
export default function SightingsJournalSection() {
|
||||||
|
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="sightings-journal"
|
||||||
|
data-vula-section="sightingsjournal"
|
||||||
|
data-vula-cms="posts"
|
||||||
|
className="py-20 bg-[#f5f5dc]"
|
||||||
|
>
|
||||||
|
<div className="max-w-7xl mx-auto px-4">
|
||||||
|
<h2 className="font-heading text-4xl md:text-5xl text-[#1b210d] mb-4 leading-tight">
|
||||||
|
The ranger’s digital sightings book
|
||||||
|
</h2>
|
||||||
|
<p className="font-serif italic text-lg text-[#8b5a3c] max-w-2xl mb-12">
|
||||||
|
Fresh notes from the bush — track the wild heartbeat of Thornveld.
|
||||||
|
</p>
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-8">
|
||||||
|
{items.map((item) => {
|
||||||
|
const d = item.data as {
|
||||||
|
title?: string
|
||||||
|
excerpt?: string
|
||||||
|
body?: string
|
||||||
|
author?: string
|
||||||
|
category?: string
|
||||||
|
image?: string
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<article
|
||||||
|
key={item.id}
|
||||||
|
className="bg-[#f7f9f4] rounded-2xl overflow-hidden shadow-soft border border-[#dee2d4] transition-all duration-200 ease-out hover:-translate-y-1 hover:shadow-lg"
|
||||||
|
>
|
||||||
|
{d.image && (
|
||||||
|
<div className="relative h-48 w-full overflow-hidden">
|
||||||
|
<Image
|
||||||
|
src={d.image}
|
||||||
|
alt={d.title || 'Sighting image'}
|
||||||
|
fill
|
||||||
|
sizes="(max-width: 768px) 100vw, 50vw"
|
||||||
|
className="object-cover hover:scale-105 transition-transform duration-500 ease-out"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<div className="p-6">
|
||||||
|
<div className="flex items-center justify-between mb-3">
|
||||||
|
{d.category && (
|
||||||
|
<Badge className="bg-[#6b8e23] text-white text-xs px-3 py-1 rounded-full">
|
||||||
|
{d.category}
|
||||||
|
</Badge>
|
||||||
|
)}
|
||||||
|
{d.author && (
|
||||||
|
<span className="text-xs text-[#8b5a3c] font-medium">{d.author}</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<h3 className="font-heading text-2xl text-[#1b210d] mb-2">{d.title}</h3>
|
||||||
|
{d.excerpt && (
|
||||||
|
<p className="font-serif italic text-[#1b210d]/70 leading-relaxed">{d.excerpt}</p>
|
||||||
|
)}
|
||||||
|
<div className="mt-4 h-px bg-[#dee2d4] w-12" />
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user