// MyAirSpace — Guided purchase wizard. Interactive multi-step flow.
const { Button, Card, Field, Select, Checkbox, Callout, Stepper, Badge, Seal } = window.MyAirSpace || {};
const Icon = window.MyAirSpaceIcon;
const STEPS = ["Your details", "Property", "Declaration", "Payment"];
function WizardShell({ children, step }) {
return (
Secure checkout
{children}
);
}
function StepHeading({ kicker, title, sub }) {
return (
{kicker}
{title}
{sub &&
{sub}
}
);
}
function Footer({ onBack, onNext, nextLabel = "Continue", canBack = true }) {
return (
{canBack ? }>Back : }
}>{nextLabel}
);
}
function PurchaseWizard() {
const [step, setStep] = React.useState(0);
const [data, setData] = React.useState({
name: "", email: "", line1: "", town: "", postcode: "", propType: "House", declare: false, terms: false,
});
const set = (k) => (e) => setData((d) => ({ ...d, [k]: e.target.value }));
const setChk = (k) => (e) => setData((d) => ({ ...d, [k]: e.target.checked }));
const next = () => setStep((s) => Math.min(s + 1, 4));
const back = () => setStep((s) => Math.max(s - 1, 0));
if (step === 4) return ;
return (
{step === 0 && (
)}
{step === 1 && (
)}
{step === 2 && (
I do not consent to drones recording identifiable footage, images, audio or personal data of me, my household, visitors or private residential spaces at the property above.
)}
{step === 3 && (
Order summary
Emailed instantly after payment
)}
);
}
function Row({ label, value, bold, muted }) {
return (
{label} {value && {value} }
);
}
function Success({ data }) {
return (
Certificate issued
You’re on record
We’ve emailed your certificate to {data.email || "your inbox"} . You can download it any time from your account.
} onClick={() => { window.location.href = "../certificate/index.html"; }}>View certificate
{ window.location.href = "../account/index.html"; }}>Go to my account
);
}
window.PurchaseWizard = PurchaseWizard;