diff --git a/src/components/sections/CampaignsSection.tsx b/src/components/sections/CampaignsSection.tsx new file mode 100644 index 0000000..7079a9a --- /dev/null +++ b/src/components/sections/CampaignsSection.tsx @@ -0,0 +1,77 @@ +'use client' + +import Image from 'next/image' +import Link from 'next/link' +import Button from '@/components/ui/Button' +import { useVulaContent } from '@/hooks/useVulaContent' + +export default function CampaignsSection() { + const { items, loading } = useVulaContent('campaigns') + + if (loading) { + return ( +
+
+
+ ) + } + + if (items.length === 0) return null + + const featured = items[0] + const rest = items.slice(1) + const d = featured?.data as { title?: string; headline?: string; body?: string; cta_text?: string; image?: string } + + return ( +
+
+
+
+

Fresh from KZN co-ops

+

Seasonal colour, made in small batches

+
+ + + +
+ +
+
+ {d?.image && ( + {d?.headline + )} +
+
+

{d?.title}

+

{d?.headline}

+ {d?.body &&

{d.body}

} + {d?.cta_text && ( + + + + )} +
+
+ +
+ {rest.slice(0, 2).map((item) => { + const x = item.data as { title?: string; headline?: string; body?: string; cta_text?: string; image?: string } + return ( +
+ {x?.image && ( + {x?.headline + )} +
+
+

{x?.headline || x?.title}

+ {x?.body &&

{x.body}

} +
+
+ ) + })} +
+
+
+
+ ) +} \ No newline at end of file