function WhatsAppButton() { const [expanded, setExpanded] = React.useState(false); const [visible, setVisible] = React.useState(false); React.useEffect(() => { const onScroll = () => setVisible(window.scrollY > 400); onScroll(); window.addEventListener('scroll', onScroll, { passive: true }); return () => window.removeEventListener('scroll', onScroll); }, []); const msg = encodeURIComponent(`Hello SSE, I'd like to enquire about your products.`); const href = `https://wa.me/${SSE_INFO.phoneRaw}?text=${msg}`; return ( setExpanded(true)} onMouseLeave={() => setExpanded(false)} style={{ position: 'fixed', bottom: 24, right: 24, zIndex: 90, display: 'flex', alignItems: 'center', gap: 12, padding: '14px 18px', borderRadius: 999, background: '#25D366', color: 'white', boxShadow: '0 12px 40px -8px rgba(37, 211, 102, 0.5), 0 2px 8px rgba(0,0,0,0.15)', opacity: visible ? 1 : 0, transform: visible ? 'translateY(0) scale(1)' : 'translateY(20px) scale(0.9)', transition: 'all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1)', fontFamily: 'var(--font-body)', fontSize: 15, fontWeight: 600, pointerEvents: visible ? 'auto' : 'none', }}>
WhatsApp us
); } Object.assign(window, { WhatsAppButton });