/* Sea La Vie — Guest portal UI (account.html). Account helpers + useAccount hook live in data.jsx so they're available site-wide; this file is just the page-specific UI. */ const { useState: useAc, useEffect: useAcEf, useMemo: useAcMm } = React; // ─── UI: HEADER FOR ACCOUNT PAGE ─────────────────────────────────────────── function AccountHeader({ onBack }) { return (
); } // ─── UI: SIGN-IN GATE ────────────────────────────────────────────────────── function SignInGate() { const [mode, setMode] = useAc("signin"); const [form, setForm] = useAc({ name: "", email: "", password: "" }); const [err, setErr] = useAc(""); const [busy, setBusy] = useAc(false); const up = (k, v) => setForm(f => ({ ...f, [k]: v })); async function submit(e) { e.preventDefault(); setBusy(true); setErr(""); const r = mode === "signin" ? await acctLogin({ email: form.email, password: form.password }) : await acctRegister({ name: form.name, email: form.email, password: form.password }); setBusy(false); if (!r.ok) setErr(r.error || "Something went wrong."); // session change triggers a re-render via useAccount } return ({mode === "signin" ? "Sign in to see your stays, track your loyalty, and unlock perks reserved for returning guests." : "Create your account in twenty seconds. The first night you book is the start of Karibu."}
{t.summary}
{policyNote}
A confirmation will go to {(currentSession() && currentSession().email) || "your email"} within twenty-four hours. Refunds reach the original payment method in five to seven working days.
Rather speak to a human? {CONTACT.email} · {CONTACT.phone}
{stats.nights > 0 ? <>You've spent {stats.nights} night{stats.nights === 1 ? "" : "s"} with us. {next ? <>Another {next.minNights - stats.nights} and {next.name} opens its quieter doors.> : <>You've reached every door we have. Asante sana.>} > : <>Your first stay will begin your Karibu chapter — and start the clock toward Rafiki and Mwenyeji.>}
To update your name, dietary preferences or stored passport details, write to your curator. We keep this lightweight by design — every Sea La Vie guest has a named human, not a form.