// booking.jsx — booking section with embedded external service const ICONS = { prescription: ( ), wallet: ( ), }; const BOOKING_URL = "https://web.cenplexbooking.ch/appointment-selection?customerId=282&locationId=465"; function Booking({ lang }) { const t = COPY[lang].booking; React.useEffect(() => { const section = document.getElementById('booking'); if (!section) return; let active = false; const pushGuard = () => { window.history.pushState({ bookingGuard: true }, ''); active = true; }; const onPopState = () => { if (active) pushGuard(); }; // Activate guard as soon as booking section scrolls into view const obs = new IntersectionObserver( ([e]) => { if (e.isIntersecting && !active) pushGuard(); }, { threshold: 0.1 } ); obs.observe(section); window.addEventListener('popstate', onPopState); return () => { obs.disconnect(); window.removeEventListener('popstate', onPopState); }; }, []); return ( {t.eyebrow} {t.title} {t.subtitle} ⚠ Termine, die nicht mindestens 24 Stunden im Voraus abgesagt werden, sowie No-Shows werden verrechnet. {t.methods.map((m, i) => ( {m.icon === "wallet" && ( )} {ICONS[m.icon]} {m.title} {m.body} ))} {t.priceTitle} {t.prices.map((p, i) => ( {p.label} CHF {p.value} ))} {lang === "de" ? "In neuem Tab öffnen ↗" : "Open in a new tab ↗"} ); } Object.assign(window, { Booking });
{t.subtitle}
⚠ Termine, die nicht mindestens 24 Stunden im Voraus abgesagt werden, sowie No-Shows werden verrechnet.
{m.body}