/* global React, Icon, VehicleCard, CV_INVENTORY, CV_FACTS */ const { useState, useEffect, useMemo, useRef } = React; // ───────────────────────────────────────────────────────────────────────────── // VEHICLE DETAIL — the hero deliverable // ───────────────────────────────────────────────────────────────────────────── function VehiclePage({ v, setPage, openVehicle }) { const gallery = useMemo(() => { return [v.image, v.detail, v.interiorShot, v.mirror].filter(Boolean); }, [v]); const [active, setActive] = useState(0); const [tab, setTab] = useState("enquire"); const [submitted, setSubmitted] = useState(false); const [form, setForm] = useState({ intent: "enquire", name: "", phone: "", email: "", message: `Hi CV Auto, I'm interested in the ${v.year} ${v.make} ${v.model}. Please share asking price and availability for a viewing.` }); useEffect(() => { setActive(0); setSubmitted(false); }, [v.id]); const onSubmit = e => { e.preventDefault(); setSubmitted(true); }; const similar = CV_INVENTORY .filter(x => x.id !== v.id && (x.tag === v.tag || x.body === v.body)) .slice(0, 4); const specs = [ ["Year", v.year], ["Make", v.make], ["Model", v.model], ["Body", v.body], ["Drivetrain", v.drivetrain], ["Transmission", v.transmission], ["Exterior", v.exterior], ["Interior", v.interior], ["Mileage", v.mileage ?? "On request"], ["Stock ID", `CV-${v.id.toUpperCase().slice(0, 12)}`] ]; return (
{/* Top breadcrumb */}
{v.year} {v.make} {v.model}
{/* Cinematic full-bleed gallery */}
{`${v.year}
{String(active + 1).padStart(2, "0")} / {String(gallery.length).padStart(2, "0")}
{gallery.map((src, i) => ( ))} {/* placeholder slots for client to supply more hi-res frames */} {Array.from({ length: Math.max(0, 6 - gallery.length) }).map((_, i) => (
+ frame
))}
{/* Headline + price + key actions */}
{v.tag} · Stock CV-{v.id.toUpperCase().slice(0, 12)} {v.badge && {v.badge}}

{v.year} {v.make} {v.model}

{v.headline}

Price
{v.price === "POA" ? Price on application : v.price}
Asking figures shared on enquiry. Excludes registration & transfer fees.
{/* Body: spec table + actions panel */}
{/* Left — spec, story, what's covered */}

Specification

{specs.map(([k, val]) => ( ))}
{k} {val}
Spec fields populate from the vehicle feed; only verified fields are rendered. Anything not published by the showroom stays "On request" rather than guessed.

Concierge notes

  • Pre-purchase inspection. Independent inspection booked on request, including paint, panel and mechanical report.
  • GCC handover. Registration, transfer and export paperwork handled in-house. Re-export packages available for GCC and CIS buyers.
  • Finance & insurance support. CV Auto introduces buyers to preferred partners. No rates are published — enquiry-based only.
  • Trade-in. Bring your current car for a same-day desk offer; can be set against the asking figure on this vehicle.
{/* Right — interactive enquiry tabs */}