Deploy
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
'use client'
|
||||
import { useState } from 'react';
|
||||
import { useVulaContent } from '@/hooks/useVulaContent'
|
||||
import Button from '@/components/ui/Button'
|
||||
import Image from 'next/image'
|
||||
|
||||
export default function CampaignSection() {
|
||||
const { items, loading } = useVulaContent('campaigns')
|
||||
const [formData, setFormData] = useState('') // hook before guard
|
||||
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="campaign-specials" data-vula-section="campaign" data-vula-cms="campaigns" className="bg-[#f4f5f2] py-20 px-4">
|
||||
<div className="max-w-6xl mx-auto">
|
||||
<div className="flex flex-col lg:flex-row gap-8 items-center">
|
||||
{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="bg-white rounded-[28px] shadow-lg overflow-hidden flex-1">
|
||||
{d.image && (
|
||||
<div className="relative h-64 lg:h-80 w-full">
|
||||
<Image src={d.image} alt={d.title ?? ''} fill className="object-cover" sizes="(max-width: 768px) 100vw, 50vw" />
|
||||
</div>
|
||||
)}
|
||||
<div className="p-8 lg:p-10">
|
||||
{d.title && <p className="text-sm text-[#8b5a3c] font-medium mb-2">{d.title}</p>}
|
||||
{d.headline && <h2 className="text-3xl lg:text-4xl font-semibold text-[#2c331f] mb-4">{d.headline}</h2>}
|
||||
{d.body && <p className="text-[#2c331f]/70 max-w-[44ch] mb-6">{d.body}</p>}
|
||||
{d.cta_text && <Button variant="default" className="bg-[#6b8e23] hover:bg-[#5a7a1d] text-white rounded-full px-6 py-2">{d.cta_text}</Button>}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user