/* global React */ const { useState, useEffect, useRef, useMemo, useCallback } = React; /* ============================================================ Icons (inline SVGs — minimal, monoline) ============================================================ */ const Icon = ({ name, size = 14 }) => { const paths = { arrow: "M5 12h14M13 6l6 6-6 6", phone: "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.79 19.79 0 0 1 2.13 4.18 2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7a2 2 0 0 1 1.72 2.03z", whatsapp: "M17.5 14.4c-.3-.1-1.6-.8-1.9-.9-.3-.1-.5-.1-.6.1-.2.3-.7.9-.9 1.1-.2.2-.3.2-.6.1-1.7-.9-2.9-1.6-4-3.5-.3-.5.3-.5.8-1.5.1-.2 0-.4 0-.5-.1-.1-.6-1.4-.8-1.9-.2-.5-.4-.4-.6-.4h-.5c-.2 0-.5.1-.7.4-.3.3-1 .9-1 2.3 0 1.4 1 2.7 1.1 2.8.1.2 2 3.1 4.9 4.3 1.8.7 2.5.8 3.4.7.5-.1 1.6-.7 1.9-1.3.2-.7.2-1.2.2-1.3-.1-.1-.3-.2-.6-.3zM12 2C6.5 2 2 6.5 2 12c0 1.8.5 3.5 1.3 5L2 22l5.2-1.4c1.4.8 3 1.2 4.8 1.2 5.5 0 10-4.5 10-10S17.5 2 12 2z", mail: "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2zM22 6l-10 7L2 6", pin: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0zM12 13a3 3 0 1 0 0-6 3 3 0 0 0 0 6z", close: "M18 6L6 18M6 6l12 12", search: "M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm10 2l-4.35-4.35", ship: "M2 20h20M3 16l9-9 9 9M5 16V8h4l3-3 3 3h4v8", sell: "M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7.5M16 8l-4-4-4 4M12 4v12", plus: "M12 5v14M5 12h14", minus: "M5 12h14", fuel: "M3 22V6a3 3 0 0 1 3-3h6a3 3 0 0 1 3 3v16M3 22h12M5 11h8M17 7l3 3v9a2 2 0 0 1-2 2", gauge: "M12 22a10 10 0 1 0-10-10c0 2.5 1 4.8 2.6 6.4L12 12V2", palette: "M12 22a10 10 0 1 1 10-10c0 2.2-1.8 4-4 4h-2a2 2 0 0 0-2 2c0 1.1.9 2 2 2v2zM7 14a1 1 0 1 0 0-2 1 1 0 0 0 0 2zM10 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2zM15 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2z" }; return ( ); }; window.Icon = Icon; /* ============================================================ Brand mark (the SVG-redrawn logo) ============================================================ */ const BrandMark = ({ dark = false }) => ( Alain Class Motors · Dubai ); window.BrandMark = BrandMark; /* ============================================================ NAV ============================================================ */ const Nav = ({ route, navigate, dark = false }) => { const links = [ { id: "inventory", label: "Inventory" }, { id: "brands", label: "Brands" }, { id: "sell", label: "Sell your car" }, { id: "export", label: "Export" }, { id: "about", label: "About" }, { id: "contact", label: "Contact" }, ]; return ( ); }; window.Nav = Nav; /* ============================================================ CTA fab (WhatsApp + Call, always visible) ============================================================ */ const CtaFab = ({ onEnquire }) => (
); window.CtaFab = CtaFab; /* ============================================================ Vehicle card ============================================================ */ const VehicleCard = ({ v, onOpen, onDark = false }) => ( ); window.VehicleCard = VehicleCard; /* ============================================================ Enquire / Request Price modal ============================================================ */ const EnquireModal = ({ open, onClose, vehicle, mode = "enquire" }) => { const [sent, setSent] = useState(false); const [form, setForm] = useState({ name: "", email: "", phone: "", country: "United Arab Emirates", notes: "" }); useEffect(() => { if (open) { setSent(false); setForm(f => ({ ...f, notes: vehicle ? "I'd like more information on the " + vehicle.year + " " + vehicle.make + " " + vehicle.model + " (Stock " + vehicle.stockId + ")." : "" })); } }, [open, vehicle]); if (!open) return null; const titles = { enquire: { eyebrow: "Enquire", h: ["Speak with our", "concierge"] }, price: { eyebrow: "Request price", h: ["Receive a private", "valuation"] }, export: { eyebrow: "Export enquiry", h: ["Worldwide", "delivery"] }, sell: { eyebrow: "Sell your car", h: ["Trade with", "Alain Class"] }, whatsapp:{ eyebrow: "WhatsApp", h: ["Reach us on", "WhatsApp"] }, }; const t = titles[mode] || titles.enquire; const submit = (e) => { e.preventDefault(); setSent(true); }; return (A member of our concierge team will reply within one business hour.
For urgent matters please call +971 4 378 2222.
{mode === "export" ? "Tell us where in the world you'd like the car delivered and we'll arrange logistics to any port or airport." : "Prices are quoted on application. Share a few details and we'll respond personally with availability, full specification and a private viewing."}
> )}