/* global React, SERVICES_DATA, POLE_ICONS */ const { useState: useState_r, useMemo: useMemo_r } = React; const RDV_STEPS = [ { id: 1, label: "Spécialité" }, { id: 2, label: "Médecin (optionnel)" }, { id: 3, label: "Créneau" }, { id: 4, label: "Coordonnées" }, { id: 5, label: "Paiement" }, { id: 6, label: "Confirmation" }, ]; const MOCK_DOCTORS = { default: [ { name: "Dr. Aïssatou Kpogli", role: "Médecin senior", lang: "FR · EN" }, { name: "Pr. Mathieu Aklassou", role: "Hospitalo-universitaire", lang: "FR" }, { name: "Dr. Évariste Dossou", role: "Praticien hospitalier", lang: "FR · EN" }, ], }; const MOCK_SLOTS = ["08:30", "09:00", "09:30", "10:30", "11:00", "11:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30"]; function CalendarMini({ value, onChange }) { const today = new Date(); const [month, setMonth] = useState_r(new Date(today.getFullYear(), today.getMonth(), 1)); const monthLabel = month.toLocaleDateString("fr-FR", { month: "long", year: "numeric" }); const days = useMemo_r(() => { const arr = []; const first = new Date(month); const startDow = (first.getDay() + 6) % 7; // Mon=0 for (let i = 0; i < startDow; i++) arr.push(null); const last = new Date(month.getFullYear(), month.getMonth() + 1, 0); for (let d = 1; d <= last.getDate(); d++) arr.push(new Date(month.getFullYear(), month.getMonth(), d)); return arr; }, [month]); const isDisabled = (d) => { if (!d) return true; const day = d.getDay(); if (day === 0 || day === 6) return true; // closed weekends const t0 = new Date(); t0.setHours(0,0,0,0); return d < t0; }; const dow = ["L", "M", "M", "J", "V", "S", "D"]; return (

{monthLabel}

{dow.map((d, i) =>
{d}
)} {days.map((d, i) => { if (!d) return ; const sel = value && d.toDateString() === value.toDateString(); const dis = isDisabled(d); const we = d.getDay() === 0 || d.getDay() === 6; return ( ); })}
); } function RdvPage({ presetSpecialty }) { const [step, setStep] = useState_r(1); const [spec, setSpec] = useState_r(presetSpecialty || null); const [doctor, setDoctor] = useState_r(null); const [date, setDate] = useState_r(null); const [slot, setSlot] = useState_r(null); const [info, setInfo] = useState_r({ first: "", last: "", phone: "", email: "", reason: "" }); const [mm, setMm] = useState_r(null); const openSpecs = SERVICES_DATA.filter(s => s.status === "open"); const goNext = () => setStep(s => Math.min(6, s + 1)); const goBack = () => setStep(s => Math.max(1, s - 1)); const canNext = step === 1 ? !!spec : step === 2 ? true : step === 3 ? !!(date && slot) : step === 4 ? !!(info.first && info.last && info.phone) : step === 5 ? !!mm : true; return (
{/* Hero light */}
Prise de rendez-vous · en ligne

Réservez votre consultation en quelques étapes.

Le CHIC fonctionne exclusivement sur rendez-vous. Consultations du lundi au vendredi, 8h–17h. Paiement par Mobile Money à la prise de RDV.

L'accès aux consultations et examens se fait uniquement sur rendez-vous. {" "}Aucun accueil d'urgence n'est possible pour le moment.

{/* Stepper */} {/* Form */}
{step === 1 && ( <>

Pour quelle spécialité ?

Sélectionnez parmi les services actuellement ouverts. Les autres seront disponibles prochainement.

{openSpecs.map(s => { const Icon = POLE_ICONS[s.pole] || IconHeart; const sel = spec && spec.name === s.name; return ( ); })}
)} {step === 2 && ( <>

Choisir un médecin

Optionnel — vous pouvez laisser l’équipe vous orienter vers le praticien disponible.

{MOCK_DOCTORS.default.map(d => ( ))}
)} {step === 3 && ( <>

Choisir un créneau

Le CHIC est ouvert du lundi au vendredi, de 8h à 17h.

{ setDate(d); setSlot(null); }} />

{date ? `Créneaux du ${date.toLocaleDateString("fr-FR", { weekday: "long", day: "numeric", month: "long" })}` : "Sélectionnez une date"}

{date ? (
{MOCK_SLOTS.map(s => ( ))}
) : (

Choisissez d’abord une date à gauche.

)}
)} {step === 4 && ( <>

Vos coordonnées

Nous utilisons ces informations pour confirmer votre rendez-vous et vous joindre si besoin.

setInfo({...info, first: e.target.value})} />
setInfo({...info, last: e.target.value})} />
setInfo({...info, phone: e.target.value})} />
setInfo({...info, email: e.target.value})} />