/* vehicle.jsx — cinematic vehicle detail page */ const { useState: useStateV, useEffect: useEffectV, useMemo: useMemoV } = React; function Vehicle({ slug, onSelect, onEnquire, navigate }) { const v = useMemoV(() => INVENTORY.find((x) => x.slug === slug) || INVENTORY[0], [slug]); const [idx, setIdx] = useStateV(0); const [showSpecs, setShowSpecs] = useStateV(false); // Build a faux gallery from the available imagery + the vehicle's own const gallery = useMemoV(() => { return [ { src: v.img, label: "Exterior · 3⁄4" }, { src: "media/showroom-interior.webp", label: "On the floor" }, { src: "media/hero-car-full.webp", label: "Profile" }, { src: "media/showroom-building-night.webp", label: "Showroom" }, { src: v.img, label: "Detail" }, ]; }, [v]); useEffectV(() => { setIdx(0); window.scrollTo({ top: 0 }); }, [slug]); useEffectV(() => { const f = (e) => { if (e.key === "ArrowRight") setIdx((i) => (i + 1) % gallery.length); if (e.key === "ArrowLeft") setIdx((i) => (i - 1 + gallery.length) % gallery.length); }; window.addEventListener("keydown", f); return () => window.removeEventListener("keydown", f); }, [gallery.length]); const similar = useMemoV(() => INVENTORY.filter((x) => x.slug !== v.slug && (x.brand === v.brand || x.body === v.body)).slice(0, 4), [v]); const specRows = useMemoV(() => { const s = v.spec || {}; const order = [ ["Year", v.year], ["Make", v.brand], ["Model", v.model], ["Body", v.body], ["Engine", s.engine], ["Power", s.power], ["Torque", s.torque], ["Drivetrain", s.drive], ["Transmission", s.trans], ["Exterior", s.exterior], ["Interior", s.interior], ["Mileage", s.mileage], ]; // Only render the rows that have a value — brief: omit unknown fields, never fill them. return order.filter(([, val]) => val != null && val !== "—" && val !== ""); }, [v]); return (
{/* ─── Top breadcrumb / title bar ─── */}
· {v.brand} / {v.model}
{v.brand} · {v.body} · {v.tag}

{v.year}{" "} {v.model}

{v.status === "available" ? "Available · in showroom" : "Sold · recently"} Demo data
{/* ─── Hero gallery ─── */}
{`${v.brand} {/* gradient bottom overlay */}
Frame {String(idx + 1).padStart(2, "0")} / {String(gallery.length).padStart(2, "0")} · {gallery[idx].label}
← → to navigate
{gallery.map((g, i) => ( ))}
{/* media pills row */}
Media slots — populated by feed
{/* ─── Main grid: details + sticky enquiry ─── */}
{/* Left: prose + specs */}
About this car

A clean, single-owner example of the {v.model.toLowerCase()}, in showroom condition and ready for inspection. Full service history is available on request — we'll walk you through provenance, configuration and options on the floor.

Specification below reflects fields verified by our team. Any field that isn't shown is intentionally omitted until it is verified against the original build sheet — we don't fill blanks.

{/* spec block */}
Specification
{specRows.length} verified fields
{specRows.map(([k, val]) => (
{k} {val}
))}
Mileage, service history & build sheet shared on enquiry — privacy first.
{/* 360 tour placeholder */}
360° interior tour
Step inside.
This slot embeds the existing 360 tour from f1rstmotors.com when wired to the feed.
{/* Right: sticky enquiry */}
{/* ─── Similar cars ─── */}
{similar.map((s) => ( ))}
); } Object.assign(window, { Vehicle });