Self-drive car rental in {window.BIZ.city} · Since {window.BIZ.since}
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 (
Self-drive car rental in {window.BIZ.city} · Since {window.BIZ.since}
Self-drive car rental in {window.BIZ.city} —
{s.marque}{s.model}