diff --git a/src/components/sections/CampaignSection.tsx b/src/components/sections/CampaignSection.tsx new file mode 100644 index 0000000..4192391 --- /dev/null +++ b/src/components/sections/CampaignSection.tsx @@ -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
+ if (items.length === 0) return null + return ( +
+
+
+ {items.map((item) => { + const d = item.data as { title?: string; headline?: string; body?: string; cta_text?: string; image?: string } + return ( +
+ {d.image && ( +
+ {d.title +
+ )} +
+ {d.title &&

{d.title}

} + {d.headline &&

{d.headline}

} + {d.body &&

{d.body}

} + {d.cta_text && } +
+
+ ) + })} +
+
+
+ ) +} \ No newline at end of file