Deploy
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
'use client'
|
||||
|
||||
import { useVulaContent } from '@/hooks/useVulaContent'
|
||||
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '@/components/ui/Card'
|
||||
import Button from '@/components/ui/Button'
|
||||
import Badge from '@/components/ui/Badge'
|
||||
import Image from 'next/image'
|
||||
|
||||
const IMAGE_PLACEHOLDER = 'https://images.pexels.com/photos/4841333/pexels-photo-4841333.jpeg?auto=compress&cs=tinysrgb&w=400&h=300&fit=crop'
|
||||
|
||||
export default function NurturingCampaignsSection() {
|
||||
const { items, loading } = useVulaContent('campaigns')
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="flex justify-center py-16">
|
||||
<div className="w-8 h-8 rounded-full border-2 border-[#8b5a3c] border-t-transparent animate-spin" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
if (items.length === 0) return null
|
||||
|
||||
return (
|
||||
<section
|
||||
id="nurturing-campaigns"
|
||||
data-vula-section="nurturingcampaigns"
|
||||
data-vula-cms="campaigns"
|
||||
className="py-20 bg-[#f9f5f4]"
|
||||
>
|
||||
<div className="container mx-auto px-4">
|
||||
<h2 className="text-4xl font-bold text-[#21140d] mb-4 text-center">
|
||||
Seasonal Blends & Limited Drops
|
||||
</h2>
|
||||
<p className="text-[#16a34a] italic text-center mb-12 max-w-2xl mx-auto">
|
||||
Small-batch creations rooted in our Pretoria studio
|
||||
</p>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||
{items.map((item) => {
|
||||
const d = item.data as {
|
||||
title?: string
|
||||
headline?: string
|
||||
body?: string
|
||||
cta_text?: string
|
||||
image?: string
|
||||
}
|
||||
const imgSrc = d.image || IMAGE_PLACEHOLDER
|
||||
|
||||
return (
|
||||
<Card key={item.id} className="overflow-hidden hover:shadow-lg transition-all duration-200 ease-out">
|
||||
<div className="relative h-56 overflow-hidden">
|
||||
<Image
|
||||
src={imgSrc}
|
||||
alt={d.title || 'Campaign image'}
|
||||
fill
|
||||
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
|
||||
className="object-cover hover:scale-105 transition-transform duration-500 ease-out"
|
||||
/>
|
||||
<Badge variant="accent" className="absolute top-3 left-3">
|
||||
Limited Edition
|
||||
</Badge>
|
||||
</div>
|
||||
<CardHeader>
|
||||
<CardTitle className="text-[#8b5a3c]">{d.title}</CardTitle>
|
||||
<CardDescription className="text-[#16a34a] font-medium">
|
||||
{d.headline}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<p className="text-[#21140d] line-clamp-3">{d.body}</p>
|
||||
</CardContent>
|
||||
<CardFooter>
|
||||
<Button variant="default" size="md" className="w-full">
|
||||
{d.cta_text || 'Shop Now'}
|
||||
</Button>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user