diff --git a/src/components/sections/KasiHeroSection.tsx b/src/components/sections/KasiHeroSection.tsx new file mode 100644 index 0000000..9225382 --- /dev/null +++ b/src/components/sections/KasiHeroSection.tsx @@ -0,0 +1,93 @@ +'use client' + +import { useState, useEffect } from 'react' +import Image from 'next/image' +import Link from 'next/link' +import Button from '@/components/ui/Button' +import { useVulaContent } from '@/hooks/useVulaContent' + +export default function KasiHeroSection() { + const { items, loading } = useVulaContent('hero_banners') + const [current, setCurrent] = useState(0) + const len = items.length + + useEffect(() => { + if (len < 2) return + const t = setInterval(() => setCurrent((c) => (c + 1) % len), 6000) + return () => clearInterval(t) + }, [len]) + + if (loading) return ( +
+
+
+ ) + if (len === 0) return null + + const d = items[current].data as { + title?: string + subtitle?: string + cta_text?: string + cta_url?: string + image?: string + } + + return ( +
+ {/* Background image */} +
+ {d.title +
+ + {/* Overlay content */} +
+
+ {d.title && ( +

+ {d.title} +

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

+ {d.subtitle} +

+ )} +
+ + + +
+
+
+ + {/* Dots */} + {len > 1 && ( +
+ {items.map((_, i) => ( +
+ )} +
+ ) +}