diff --git a/src/components/sections/HeroBannerSection.tsx b/src/components/sections/HeroBannerSection.tsx new file mode 100644 index 0000000..c359c69 --- /dev/null +++ b/src/components/sections/HeroBannerSection.tsx @@ -0,0 +1,78 @@ +'use client' +import { useEmDashContent } from '@/hooks/useEmDashContent' +import Image from 'next/image' +import Button from '@/components/ui/Button' + +export default function HeroBannerSection() { + const { items, loading } = useEmDashContent('hero_banners') + + if (loading) { + return ( +
+
+
+ ) + } + + if (items.length === 0) return null + + return ( + <> + {items.map((item) => { + const d = item.data as { + title?: string + subtitle?: string + cta_text?: string + cta_url?: string + image?: string + } + return ( +
+ {d.image && ( +
+ {d.title +
+ )} +
+ {d.title && ( +

+ {d.title} +

+ )} + {d.subtitle && ( +

+ {d.subtitle} +

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