(function (global) { function ServiceCard({ service, onSelect }) { return ( {service.name} ); } function OtherServicesCarousel({ title, tagLabel, services }) { const { useState, useEffect, useCallback } = React; const [currentIndex, setCurrentIndex] = useState(0); const [visibleCards, setVisibleCards] = useState(3); useEffect(() => { const updateVisible = () => { if (window.innerWidth <= 639) { setVisibleCards(1); } else if (window.innerWidth <= 1023) { setVisibleCards(2); } else { setVisibleCards(3); } }; updateVisible(); window.addEventListener('resize', updateVisible); return () => window.removeEventListener('resize', updateVisible); }, []); const maxIndex = Math.max(0, services.length - visibleCards); useEffect(() => { if (currentIndex > maxIndex) { setCurrentIndex(maxIndex); } }, [currentIndex, maxIndex]); const goPrev = useCallback(() => { setCurrentIndex((prev) => (prev <= 0 ? maxIndex : prev - 1)); }, [maxIndex]); const goNext = useCallback(() => { setCurrentIndex((prev) => (prev >= maxIndex ? 0 : prev + 1)); }, [maxIndex]); return ( Explore More {title} {services.length > visibleCards && ( ← → )} {services.map((srv) => ( {tagLabel} {srv.name} {srv.subtitle && ( {srv.subtitle} )} View Service → ))} ); } global.ShieldPointComponents = global.ShieldPointComponents || {}; global.ShieldPointComponents.ServiceCard = ServiceCard; global.ShieldPointComponents.OtherServicesCarousel = OtherServicesCarousel; })(window);
{srv.subtitle}