/* Consult booking — mock flow. * Date → time → contact form → confirmation. Reads stack context from * sessionStorage if user came from BioReveal, otherwise renders generic. * No real backend; submission stays client-side and shows a confirmation. */ const TIMES = [ { t: "9:00 AM", taken: false }, { t: "10:30 AM", taken: false }, { t: "12:00 PM", taken: true }, { t: "1:30 PM", taken: false }, { t: "3:00 PM", taken: false }, { t: "4:30 PM", taken: true }, { t: "6:00 PM", taken: false }, ]; const CLINICIANS = [ { name: "Dr. Maya Brennan, MD", cred: "Internal Medicine · Functional Med fellow", years: 11, photo: null, color: "#10b981" }, { name: "Dr. Jonas Reid, DO", cred: "Sports Medicine · Endocrine focus", years: 9, photo: null, color: "#6366f1" }, { name: "Dr. Tara Olamide, MD", cred: "Anti-aging · Hormone optimization", years: 14, photo: null, color: "#f59e0b" }, ]; function getNextDays(n) { const days = []; const now = new Date(); for (let i = 1; i <= n; i++) { const d = new Date(now); d.setDate(now.getDate() + i); days.push(d); } return days; } function fmtDay(d) { return d.toLocaleDateString("en-US", { weekday: "short" }).toUpperCase(); } function fmtNum(d) { return d.getDate(); } function fmtMonth(d) { return d.toLocaleDateString("en-US", { month: "short" }).toUpperCase(); } function fmtFull(d) { return d.toLocaleDateString("en-US", { weekday: "long", month: "long", day: "numeric" }); } const ConsultPage = () => { const Header = window.Header; const Footer = window.Footer; const days = React.useMemo(() => getNextDays(10), []); const [step, setStep] = React.useState("schedule"); // schedule | form | done const [selectedDay, setSelectedDay] = React.useState(days[0]); const [selectedTime, setSelectedTime] = React.useState(null); const [clinician, setClinician] = React.useState(CLINICIANS[0]); const [form, setForm] = React.useState({ name: "", email: "", phone: "", note: "" }); const [errors, setErrors] = React.useState({}); // Pull BioReveal context if it exists const stackCtx = React.useMemo(() => { try { const raw = sessionStorage.getItem("br_protocol_summary"); return raw ? JSON.parse(raw) : null; } catch { return null; } }, []); function pickTime(t) { setSelectedTime(t); setStep("form"); window.scrollTo({ top: 0, behavior: "smooth" }); } function submit(e) { e.preventDefault(); const errs = {}; if (!form.name.trim()) errs.name = "Required"; if (!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(form.email)) errs.email = "Valid email required"; if (!form.phone.trim() || form.phone.replace(/\D/g, "").length < 10) errs.phone = "10-digit phone required"; setErrors(errs); if (Object.keys(errs).length) return; setStep("done"); window.scrollTo({ top: 0, behavior: "smooth" }); } return (
{/* HERO */}
★ THE NEXT STEP

{step === "done" ? "You're booked." : "Book your $0 MD consult."}

{step === "done" ? `We sent a confirmation to ${form.email}. ${clinician.name.split(",")[0]} will join you ${fmtFull(selectedDay)} at ${selectedTime}.` : "20 minutes with a licensed U.S. clinician. They review your protocol, ask about your history, and either approve, adjust, or pause before anything ships. Free — no card required."}

{/* STACK SUMMARY (if from BioReveal) */} {stackCtx && step !== "done" && (
Reviewing on this consult
{stackCtx.stackName || "Your BioReveal stack"}
{stackCtx.peptides && stackCtx.peptides.length > 0 && (
{stackCtx.peptides.join(" · ")}
)}
{stackCtx.total && (
EST. STACK
${stackCtx.total}/mo
)}
)} {/* STEP: SCHEDULE */} {step === "schedule" && ( <> {/* Clinician picker */}
★ CHOOSE A CLINICIAN
{CLINICIANS.map(c => ( ))}
{/* Date picker */}
★ PICK A DAY
{days.map((d, i) => { const isSel = d.toDateString() === selectedDay.toDateString(); return ( ); })}
{/* Time slots */}
★ AVAILABLE TIMES — {fmtFull(selectedDay).toUpperCase()}
{TIMES.map(s => ( ))}
)} {/* STEP: FORM */} {step === "form" && (
Confirming
{clinician.name.split(",")[0]} · {fmtFull(selectedDay)} · {selectedTime}
★ YOUR DETAILS
setForm({...form, name: e.target.value})} placeholder="Jane Doe" /> setForm({...form, email: e.target.value})} placeholder="you@email.com" /> setForm({...form, phone: e.target.value})} placeholder="(555) 123-4567" />