// ============ Booking Modal — multi-step consultation flow ============ function BookingModal({ open, onClose }) { const [step, setStep] = React.useState(0); const [data, setData] = React.useState({ specialty: null, doctor: null, date: null, slot: null, name: "", phone: "", email: "", contactPref: "whatsapp", notes: "", }); React.useEffect(() => { if (!open) { setStep(0); } }, [open]); if (!open) return null; const D = window.EUROMED_DATA; const set = (k, v) => setData((x) => ({ ...x, [k]: v })); // Calendar — next 14 days, weekends "limited" (clinic note) const today = new Date(2026, 4, 25); // demo fixed: 25 May 2026 Mon const days = Array.from({ length: 14 }, (_, i) => { const d = new Date(today); d.setDate(d.getDate() + i); return d; }); const SLOTS = ["10:00", "10:30", "11:00", "11:30", "14:00", "14:30", "15:30", "16:00", "16:30", "17:00", "17:30", "18:00"]; const dayLabel = (d) => d.toLocaleDateString("en", { weekday: "short" }); const dayNum = (d) => d.getDate(); const isFri = (d) => d.getDay() === 5; const stepNames = ["Specialty", "Doctor", "Date & time", "Your details", "Confirm"]; const canNext = [ !!data.specialty, !!data.doctor, !!data.date && !!data.slot, data.name.trim().length > 1 && data.phone.trim().length > 5, true, ][step]; const doctorsForSpec = data.specialty ? D.DOCTORS.filter((d) => { const s = data.specialty; if (s.id === "dental") return d.specialty === "Dental"; if (s.id === "hair-transplant" || s.id === "plastic-surgery") return d.specialty === "Plastic Surgery"; if (s.id === "cosmetic-aesthetic") return d.specialty === "Dermatology & Skin" || d.specialty === "Plastic Surgery"; if (s.id === "family-medicine") return d.specialty === "Family Medicine"; if (s.id === "wellness") return d.specialty === "Wellness"; return true; }) : []; return (
Which area is your visit about? Your initial consultation is free — typically 30 minutes with a doctor.
Pick a consultant, or choose "any available" and we'll match you.
Next available slots in the coming two weeks:
We only collect what's needed to confirm your appointment. No medical history fields at this stage.
Thanks, {data.name || "—"}. We've received your request. A coordinator will confirm by{" "} {data.contactPref === "whatsapp" ? "WhatsApp" : data.contactPref} within one working hour during clinic hours.