/* Shared UI primitives + Nav + Footer + Modal + WhatsApp FAB */ const { useState, useEffect, useRef, useMemo, Fragment } = React; /* ============================================================ NAV ============================================================ */ function Nav({ page, navigate, light, openEnquire, lang, setLang }) { const [scrolled, setScrolled] = useState(false); useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 30); onScroll(); window.addEventListener("scroll", onScroll); return () => window.removeEventListener("scroll", onScroll); }, []); const items = [ { id: "collection", label: "Collection" }, { id: "wanted", label: "Wanted" }, { id: "services", label: "Services" }, { id: "about", label: "About" }, { id: "faqs", label: "FAQs" }, { id: "media", label: "Media" }, { id: "contact", label: "Contact" }, ]; return (
navigate("home")}> Tomini Classics
{["EN","AR","RU","ZH"].map(l => ( setLang(l)}>{l} ))}
); } /* ============================================================ FOOTER ============================================================ */ function Footer({ navigate, openEnquire }) { return ( ); } /* ============================================================ ENQUIRE MODAL (kind: 'general' | 'vehicle' | 'viewing' | 'valuation' | 'storage' | 'sell') ============================================================ */ function EnquireModal({ kind, vehicle, onClose, onSubmit, whatsappOn, defaultTab }) { const tabs = useMemo(() => [ { id: "enquire", label: "Enquire" }, { id: "details", label: "Request Details" }, { id: "viewing", label: "Book Viewing" }, ], []); const [tab, setTab] = useState(defaultTab || (kind === "viewing" ? "viewing" : "enquire")); const [sent, setSent] = useState(false); const title = useMemo(() => { if (kind === "vehicle") return `Enquire — ${vehicle.year} ${vehicle.make} ${vehicle.model}`; if (kind === "valuation") return "Request a Valuation"; if (kind === "storage") return "Storage Enquiry"; if (kind === "sell") return "Sell Us Your Car"; if (kind === "viewing") return "Book a Viewing"; return "Enquire"; }, [kind, vehicle]); const deck = useMemo(() => { if (kind === "vehicle") return "We'll come back to you personally — usually within one business day."; if (kind === "sell") return "Tell us about your car. If it fits our profile of post-war collectible sportscars, we'll be in touch."; if (kind === "storage") return "White-glove, climate-controlled, monthly. Minimum one month — twenty-four-hour access by prior arrangement."; return "A direct line to our Classics team. We answer in person, not by template."; }, [kind]); function submit(e) { e.preventDefault(); setSent(true); onSubmit && onSubmit({ kind, tab, vehicle }); } return (
e.stopPropagation()}> {!sent ? (

{title}

{deck}

{kind === "vehicle" && (
{tabs.map(t => ( ))}
)}
{kind === "viewing" || tab === "viewing" ? (
) : null} {kind === "sell" && (