// ===== Info / static pages =====
const { useState: useIS } = React;
const InfoPage = () => {
const params = new URLSearchParams(location.search);
const topic = params.get("topic") || "about";
const t = INFO_TOPICS[topic] || INFO_TOPICS.about;
return (
{() => (
{[
["about","About"], ["showroom","Showroom"], ["blog","Blog"],
["faq","FAQ"], ["warranty","Warranty"], ["shipping","Shipping"],
["support","Support"], ["contact","Contact"],
].map(([k,l]) => (
{l}
))}
{t.stats && (
{t.stats.map(([n, l], i) => (
))}
)}
{t.body && (
{t.body.map((b, i) => (
{String(i+1).padStart(2,"0")}
))}
)}
{t.faq && (
{t.faq.map(([q, a], i) => )}
)}
{t.contact && }
{t.cta && (
)}
Need a hand?
Our team responds in < 5 min on chat during business hours.
)}
);
};
const FaqItem = ({ q, a, idx }) => {
const [open, setOpen] = useIS(idx === 0);
return (
{open &&
}
);
};
const ContactForm = () => {
const [reason, setReason] = useIS("question");
const [sent, setSent] = useIS(false);
const [form, setForm] = useIS({ name: "", email: "", phone: "", msg: "" });
const set = (k, v) => setForm(p => ({ ...p, [k]: v }));
if (sent) return (
Message received
Thanks {form.name.split(" ")[0]}, we'll reply within 24 hours on weekdays.
Back to shop
);
return (
);
};
ReactDOM.createRoot(document.getElementById("root")).render();