Deploy
This commit is contained in:
@@ -0,0 +1,51 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import { useEmDashContent } from '@/hooks/useEmDashContent'
|
||||||
|
import Image from 'next/image'
|
||||||
|
import { ArrowRight } from 'lucide-react'
|
||||||
|
|
||||||
|
const CURRENCY_SYMBOLS: Record<string, string> = { zar: 'R', usd: '$', eur: '€', gbp: '£', kes: 'KSh', ngn: '₦', ghs: '₵' }
|
||||||
|
const formatPrice = (amount: number, code?: string) => {
|
||||||
|
const sym = CURRENCY_SYMBOLS[(code ?? '').toLowerCase()] ?? (code?.toUpperCase() ?? '')
|
||||||
|
return `${sym}${(amount / 100).toFixed(2)}`
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function CampaignsSection() {
|
||||||
|
const { items, loading } = useEmDashContent('campaigns')
|
||||||
|
|
||||||
|
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="campaigns" data-vula-section="campaigns" data-vula-cms="campaigns" className="bg-[#121212] py-20 px-6">
|
||||||
|
<div className="max-w-6xl mx-auto">
|
||||||
|
<h2 className="text-3xl lg:text-4xl font-bold text-[#F5F5F5] mb-4">Limited Drops & Collabs</h2>
|
||||||
|
<p className="text-[#F5F5F5]/70 mb-12 max-w-2xl">Fresh campaigns that keep the streets talking.</p>
|
||||||
|
<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; headline?: string; body?: string; cta_text?: string; image?: string }
|
||||||
|
return (
|
||||||
|
<div key={item.id} className="rounded-xl overflow-hidden bg-white shadow-md hover:shadow-[var(--shadow-lifted)] hover:-translate-y-0.5 transition-all duration-200 ease-out">
|
||||||
|
{d.image && (
|
||||||
|
<div className="relative h-48 w-full">
|
||||||
|
<Image src={d.image} alt={d.title ?? d.headline ?? ''} fill className="object-cover" sizes="(max-width: 768px) 100vw, 50vw" />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<div className="p-5">
|
||||||
|
<h3 className="text-lg font-semibold text-gray-900 mb-1">{d.title}</h3>
|
||||||
|
{d.headline && <p className="text-sm text-gray-500 mb-2">{d.headline}</p>}
|
||||||
|
{d.body && <p className="text-sm text-gray-600 mb-4 line-clamp-3">{d.body}</p>}
|
||||||
|
{d.cta_text && (
|
||||||
|
<span className="inline-flex items-center gap-1 text-[#4A9EFF] font-medium text-sm hover:underline">
|
||||||
|
{d.cta_text} <ArrowRight className="w-4 h-4" />
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user