Deploy
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
'use client'
|
||||
|
||||
import { useEmDashContent } from '@/hooks/useEmDashContent'
|
||||
import Image from 'next/image'
|
||||
import { Card, CardHeader, CardTitle, CardContent, CardFooter } from '@/components/ui/Card'
|
||||
import { BookOpen } from 'lucide-react'
|
||||
|
||||
export default function BushChronicleSection() {
|
||||
const { items, loading } = useEmDashContent('posts')
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="flex justify-center py-20">
|
||||
<div className="w-8 h-8 rounded-full border-2 border-current border-t-transparent animate-spin text-[#36454F]" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
if (items.length === 0) return null
|
||||
|
||||
// Only show up to 3 posts
|
||||
const visibleItems = items.slice(0, 3)
|
||||
|
||||
return (
|
||||
<section id="bush-chronicle" data-vula-section="bushchronicle" data-vula-cms="posts" className="py-20 bg-[#f2f4f5]">
|
||||
<div className="container mx-auto px-4 max-w-7xl">
|
||||
<h2 className="text-3xl md:text-4xl font-light text-[#36454F] mb-4 text-center">
|
||||
Tales from the <span className="font-semibold text-[#d4af37]">bush</span>
|
||||
</h2>
|
||||
<p className="text-[#1f2b33] text-center max-w-xl mx-auto mb-12 text-lg leading-relaxed">
|
||||
Notes on wild moments, conservation milestones, and the chef's table under the stars.
|
||||
</p>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||
{visibleItems.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="rounded-[24px] shadow-2xl shadow-black/10 overflow-hidden border-0 transition-all duration-300 hover:shadow-3xl hover:-translate-y-1">
|
||||
{d.image && (
|
||||
<div className="relative h-48 w-full overflow-hidden">
|
||||
<Image
|
||||
src={d.image}
|
||||
alt={d.title || 'Post image'}
|
||||
fill
|
||||
sizes="(max-width: 768px) 100vw, 33vw"
|
||||
className="object-cover transition-transform duration-500 ease-out hover:scale-105"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<CardHeader className="px-6 pt-6 pb-0">
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
{d.category && (
|
||||
<span className="text-xs uppercase tracking-wider text-[#d4af37] font-semibold">{d.category}</span>
|
||||
)}
|
||||
</div>
|
||||
<CardTitle className="text-xl font-medium text-[#36454F]">{d.title}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="px-6 py-4">
|
||||
<p className="text-[#1f2b33] text-sm leading-relaxed">{d.excerpt}</p>
|
||||
</CardContent>
|
||||
<CardFooter className="px-6 pb-6 pt-0 flex items-center justify-between">
|
||||
<span className="text-xs text-[#1f2b33]/60">
|
||||
{d.author ? `By ${d.author}` : ''}
|
||||
</span>
|
||||
<a
|
||||
href="#"
|
||||
className="inline-flex items-center text-xs font-medium text-[#16a34a] hover:underline transition-all"
|
||||
>
|
||||
<BookOpen className="w-3 h-3 mr-1" /> Read more
|
||||
</a>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
<div className="flex justify-center mt-10">
|
||||
<p className="text-[#1f2b33] text-sm italic">
|
||||
Recent dispatches from the reserve — updated each season.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user