/* Shared components — Deals on Wheels */ const { useState, useEffect, useRef, useMemo, useCallback } = React; /* ---------- Logo (redrawn — original SVG mark) ---------- */ function Logo({ size = 36, mono = false }) { const stroke = mono ? "currentColor" : "var(--gold)"; return ( {/* abstract car silhouette */} {/* checker flourish */} ); } function LogoLockup({ mono = false, compact = false }) { return (
Deals on Wheels
Dubai · Est. 2008
); } /* ---------- Navbar ---------- */ function Navbar({ route, navigate, theme, onContact, onAr }) { const [scrolled, setScrolled] = useState(false); const [mobileOpen, setMobileOpen] = useState(false); useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 30); window.addEventListener("scroll", onScroll); onScroll(); return () => window.removeEventListener("scroll", onScroll); }, []); const items = [ { id: "inventory", label: "Inventory" }, { id: "sell", label: "Sell / Trade-in" }, { id: "finance", label: "Finance" }, { id: "metaverse", label: "Virtual Showroom" }, { id: "about", label: "About" }, { id: "contact", label: "Contact" }, ]; const lightTheme = theme === "light"; const bg = scrolled ? (lightTheme ? "rgba(247,244,238,0.92)" : "rgba(11,13,16,0.88)") : (lightTheme ? "rgba(247,244,238,0.6)" : "rgba(11,13,16,0.0)"); const textColor = lightTheme ? "var(--text-ink)" : "var(--text)"; const borderColor = scrolled ? (lightTheme ? "rgba(0,0,0,0.06)" : "var(--line)") : "transparent"; return (
{["EN", "AR", "RU", "中文"].map((lang) => ( ))}
); } /* ---------- Vehicle Card ---------- */ function VehicleCard({ v, onClick, dark = true }) { const priceText = v.askPrice ? "Request Price" : `AED ${v.price.toLocaleString()}`; return (
onClick(v)} style={{ display: "flex", flexDirection: "column", background: dark ? "var(--ink)" : "var(--paper)", border: `1px solid ${dark ? "var(--line)" : "rgba(0,0,0,0.08)"}`, color: dark ? "var(--text)" : "var(--text-ink)", cursor: "pointer", transition: "transform .3s, border-color .3s", }} onMouseEnter={(e) => e.currentTarget.style.borderColor = "var(--gold)"} onMouseLeave={(e) => e.currentTarget.style.borderColor = dark ? "var(--line)" : "rgba(0,0,0,0.08)"}>
{`${v.year} e.currentTarget.style.transform = "scale(1.04)"} onLoad={(e) => { e.currentTarget.style.opacity = 1; }} />
{v.id.toUpperCase()}
{v.tags && v.tags[0] && (
{v.tags[0]}
)}
{v.year} · {v.make}
{v.model} {v.variant}
Mileage
{v.mileage.toLocaleString()} km
Engine
{v.engine.split(" ").slice(0, 2).join(" ")}
0–100
{v.zeroToHundred}
Price
{priceText}
View —
); } /* ---------- Section header (consistent across pages) ---------- */ function SectionHead({ eyebrow, title, sub, align = "left", light = false, action }) { return (
{eyebrow &&
{eyebrow}
}

{title}

{sub && (

{sub}

)}
{action &&
{action}
}
); } /* ---------- Footer ---------- */ function Footer({ navigate, onContact }) { return ( ); } /* ---------- Enquiry Modal ---------- */ function EnquiryModal({ open, onClose, vehicle, mode = "enquire" }) { const [sent, setSent] = useState(false); useEffect(() => { if (!open) setSent(false); }, [open]); if (!open) return null; const titles = { enquire: "Enquire", price: "Request Price", viewing: "Book a Viewing", contact: "Get in Touch", }; const subs = { enquire: "A senior advisor will reply within the working day. We'll arrange a private viewing if you'd like.", price: "Pricing is confirmed per buyer, factoring spec, mileage and import status. We share full numbers privately.", viewing: "Book a private viewing at the Al Quoz showroom. Espresso, no pressure.", contact: "Tell us what you're looking for — or send a registration number for a trade-in valuation.", }; return (
e.stopPropagation()} style={{ background: "var(--ink)", border: "1px solid var(--line)", maxWidth: 920, width: "100%", maxHeight: "90vh", overflow: "auto", display: "grid", gridTemplateColumns: vehicle ? "1fr 1fr" : "1fr", }} className="modal-grid"> {vehicle && (
{vehicle.id.toUpperCase()}
{vehicle.year} {vehicle.make}
{vehicle.model} {vehicle.variant}
)}
{vehicle ? "Vehicle Enquiry" : "Direct Line"}

{titles[mode]}

{subs[mode]}

{!sent ? (
{ e.preventDefault(); setSent(true); }} style={{ display: "flex", flexDirection: "column", gap: 22, marginTop: 28, flex: 1 }}>
{mode === "viewing" && (
)}