const { Button, Select, Input, Icon } = window.FriendsCarsDesignSystem_f69f0e; const SLIDE_MS = 7000; function HeroStage({ onNavigate, onBook }) { const S = window.HERO; const [i, setI] = React.useState(0); const [hold, setHold] = React.useState(false); /* Only the slides that have been shown (plus the next one) are in the DOM, so the page starts on one photograph. */ const [seen, setSeen] = React.useState(() => new Set([0, 1])); React.useEffect(() => { setSeen((p) => (p.has(i) && p.has((i + 1) % S.length) ? p : new Set(p).add(i).add((i + 1) % S.length))); }, [i, S.length]); React.useEffect(() => { if (hold) return; const t = setTimeout(() => setI((n) => (n + 1) % S.length), SLIDE_MS); return () => clearTimeout(t); }, [i, hold, S.length]); const s = S[i]; const car = s.carId ? window.FLEET.find((c) => c.id === s.carId) : null; const go = (n) => setI((n + S.length) % S.length); const ask = "https://wa.me/" + window.BIZ.waBook + "?text=" + encodeURIComponent("Hello Friends Car, please share the daily rate and availability for the " + s.marque + " " + s.model + "."); return (
setHold(true)} onMouseLeave={() => setHold(false)}>
{S.map((x, n) => (
{seen.has(n) ? ( {x.marque ) : null}
))}

Self-drive car rental in {window.BIZ.city} · Since {window.BIZ.since}

Self-drive car rental in {window.BIZ.city} — {s.marque}{s.model}

{s.fuel}{s.gearbox}{s.seats} seats{window.BIZ.kmPerDay} km / day
{car ? {window.rupees(car.price)}per day, {window.BIZ.kmPerDay} km included : Rate on requestIn the yard, not yet on the price list}
{car ? : }
{S.map((x, n) => ( ))}
{("0" + (i + 1)).slice(-2)} / {("0" + S.length).slice(-2)}
); } function BookingPanel({ onSubmit }) { const today = new Date().toISOString().slice(0, 10); const [cat, setCat] = React.useState(""); const [car, setCar] = React.useState(""); const cars = window.FLEET.filter((c) => !cat || c.cat === cat); return (
Check availability or call {window.BIZ.phone1}
setCar(e.target.value)} options={cars.map((c) => ({ value: c.id, label: c.name }))} />
); } Object.assign(window, { HeroStage, BookingPanel });