// Contact — dark teal section with copy/contact details on the left and // an inline Calendly embed on the right (replacing the previous static form). function CalendlyInline({ url }) { const ref = React.useRef(null); const [height, setHeight] = React.useState(660); React.useEffect(() => { if (!url || !ref.current) return; const existing = document.querySelector('script[data-calendly]'); if (!existing) { const s = document.createElement('script'); s.src = 'https://assets.calendly.com/assets/external/widget.js'; s.async = true; s.setAttribute('data-calendly', 'true'); document.body.appendChild(s); } else if (window.Calendly && window.Calendly.initInlineWidget) { window.Calendly.initInlineWidget({ url, parentElement: ref.current }); } }, [url]); React.useEffect(() => { if (document.querySelector('link[data-calendly-css]')) return; const link = document.createElement('link'); link.rel = 'stylesheet'; link.href = 'https://assets.calendly.com/assets/external/widget.css'; link.setAttribute('data-calendly-css', 'true'); document.head.appendChild(link); }, []); // Snap container to the height Calendly's iframe actually needs. React.useEffect(() => { function onMessage(e) { if (!e.data || typeof e.data !== 'object') return; if (e.data.event === 'calendly.page_height') { const raw = e.data.payload && e.data.payload.height; const h = typeof raw === 'number' ? raw : parseInt(raw, 10); if (h > 100) setHeight(h); } } window.addEventListener('message', onMessage); return () => window.removeEventListener('message', onMessage); }, []); return (
); } function Contact({ calendlyUrl = 'https://calendly.com/chekbooks-schedule/bookkeeping-discovery-call-zoom-meeting-clone?hide_event_type_details=1' }) { return (Book a free 30-minute call. We'll talk through your business, your books, and the support you need.