/* Superior Car Rental — Fleet listing + Car detail screens */
/* =========================
FLEET LISTING
========================= */
const FleetScreen = ({ navigate, initialCat = "all" }) => {
const [cat, setCat] = useState(initialCat);
const [brand, setBrand] = useState("all");
const [priceBand, setPriceBand] = useState("all");
const [sort, setSort] = useState("featured");
useEffect(() => { window.scrollTo(0, 0); }, []);
const filtered = useMemo(() => {
let arr = SCR_DATA.FLEET.slice();
if (cat !== "all") arr = arr.filter(c => c.cat === cat);
if (brand !== "all") arr = arr.filter(c => c.make === brand);
if (priceBand !== "all") {
const [lo, hi] = priceBand.split("-").map(Number);
arr = arr.filter(c => c.fromRate >= lo && c.fromRate <= (hi||Infinity));
}
if (sort === "price-asc") arr.sort((a,b) => a.fromRate - b.fromRate);
else if (sort === "price-desc") arr.sort((a,b) => b.fromRate - a.fromRate);
else if (sort === "newest") arr.sort((a,b) => b.year - a.year);
else arr.sort((a,b) => (b.featured?1:0) - (a.featured?1:0));
return arr;
}, [cat, brand, priceBand, sort]);
return (
{/* Page header */}
The fleet
{filtered.length} cars,
ready to drive.
Filter by body, brand, or budget. Every car ships with free delivery in Dubai & UAE. Rates shown are indicative — confirm at booking.
{/* Filter bar */}
{SCR_DATA.CATEGORIES.map(c => (
setCat(c.id)}>
{c.label}
))}
setBrand(e.target.value)}>
All brands
{SCR_DATA.BRANDS.map(b => {b} )}
setPriceBand(e.target.value)}>
Any price
Under AED 1,000/day
AED 1,000–2,000
AED 2,000–3,500
AED 3,500+
setSort(e.target.value)}>
Featured
Newest
Price ↑
Price ↓
{/* Grid */}
{filtered.length === 0 ? (
No cars match your filters yet — try widening the brand or price.
) : (
{filtered.map(c => (
navigate({name:"car", id: c.id})}/>
))}
)}
);
};
/* =========================
CAR DETAIL
========================= */
const CarDetailScreen = ({ navigate, carId, onReserve }) => {
const car = useMemo(() => SCR_DATA.FLEET.find(c => c.id === carId), [carId]);
const [pickupDate, setPickupDate] = useState(todayPlus(1));
const [returnDate, setReturnDate] = useState(todayPlus(4));
const [pickupLoc, setPickupLoc] = useState("dxb");
const [fav, setFav] = useState(false);
useEffect(() => { window.scrollTo(0, 0); }, [carId]);
if (!car) return null;
const days = Math.max(1, Math.round((new Date(returnDate) - new Date(pickupDate)) / 86400000));
const subtotal = car.fromRate * days;
const delivery = 0;
const total = subtotal + delivery;
const similar = SCR_DATA.FLEET.filter(c => c.cat === car.cat && c.id !== car.id).slice(0, 3);
const reserveMsg = `Hi Superior Rental, I'd like to reserve the ${car.year} ${car.make} ${car.model}.\nPickup: ${fmtDate(pickupDate)} from ${SCR_DATA.PICKUP_LOCATIONS.find(p=>p.id===pickupLoc)?.label}\nReturn: ${fmtDate(returnDate)}\n(${days} days)`;
return (
{/* Hero image */}
{/* Title block */}
{car.cat.toUpperCase()} · {car.body}
SCR-{car.id.slice(-4).toUpperCase()}
setFav(!fav)} style={{color: fav?"var(--accent)":"var(--muted-2)",display:"flex",alignItems:"center",gap:6}}>
{fav?"Saved":"Save"}
{car.make}
· {car.year}
{car.model}
{car.blurb}
onReserve({car, pickupDate, returnDate, pickupLoc})}>
Reserve
window.open(waLink(reserveMsg))}>
WhatsApp
window.open("tel:+971567671411")}>
Call
{/* Price card */}
From — indicative
AED
{SCR_DATA.formatAED(car.fromRate)}
/ day
Deposit
AED {SCR_DATA.formatAED(car.deposit)}
Min. rental
{car.minDays} day
Rates vary by season & duration. Final quote at booking includes Salik, fuel deposit, and any add-ons (chauffeur, child seat, additional driver).
{/* Body */}
{/* Left column */}
{/* Specs */}
01 Specification
Engine {car.engine}
Power {car.power}
0–100 km/h {car.zeroTo}
Top speed {car.topSpeed}
Transmission {car.transmission}
Drivetrain {car.drivetrain}
Seats / Doors {car.seats} / {car.doors}
Fuel {car.fuel}
Year {car.year}
Exterior {car.color}
Spec values are indicative of the typical configuration of this model. Individual vehicles may vary — confirm at booking.
{/* Features */}
02 Features & equipment
{car.features.map((f, i) => {f} )}
{/* Gallery (use same image with overlays — placeholders flagging "client to supply") */}
03 Gallery · additional angles to follow
{/* Rental terms / requirements */}
04 What you'll need
Driver requirements
Valid UAE driving licence — or, for visitors, your home licence plus an International Driving Permit. Exact age & document specifics confirmed at booking.
Deposit & mileage
Refundable security deposit of AED {SCR_DATA.formatAED(car.deposit)} on this car (varies by model). Daily mileage cap {car.mileageCap}. Extra distance billed at pickup rate.
Free delivery, UAE-wide
We bring the car to your hotel, residence, DXB curbside or any address in the UAE — at no extra cost.
24/7 concierge
Lost the key at the beach? Salik gate trouble? One WhatsApp number — answered at any hour. +971 56 767 1411.
{/* Right column — booking */}
Check availability
STEP 1 / 3
Pickup location
setPickupLoc(e.target.value)}>
{SCR_DATA.PICKUP_LOCATIONS.map(p => {p.label} )}
{SCR_DATA.formatAED(car.fromRate)} × {days} day{days>1?"s":""}
{SCR_DATA.formatAED(subtotal)}
Free delivery
Included
Refundable deposit
{SCR_DATA.formatAED(car.deposit)}
Indicative total
{SCR_DATA.formatAED(total)}
Final quote at booking · Salik & fuel deposit additional
onReserve({car, pickupDate, returnDate, pickupLoc, days, total})}>
Continue to reserve
window.open(waLink(reserveMsg))}>
WhatsApp
window.open("tel:+971567671411")}>
Call
No card charged until confirmed
Free cancellation 24h before pickup
Insurance & CDW included
{/* Similar cars */}
{similar.length > 0 && (
You might also like
Other {car.body.toLowerCase()}s in the fleet
navigate({name:"fleet", cat: car.cat})}>All {car.cat}
{similar.map(c => navigate({name:"car", id: c.id})}/>)}
)}
);
};
/* Placeholder for missing gallery shots */
const PlaceholderShot = ({ label }) => (
[ client to supply ]
{label}
);
Object.assign(window, { FleetScreen, CarDetailScreen, PlaceholderShot });