const { Button, SearchField, FilterBar, Card, Icon, Badge } = window.FriendsCarsDesignSystem_f69f0e; const FACETS = ["Premium", "MUV", "7 seater", "Sedan", "Hatchback", "Automatic", "Diesel", "Under ₹4,000"]; function FleetScreen({ onOpen, onBook }) { const store = window.useStore(); const [selected, setSelected] = React.useState([]); const [q, setQ] = React.useState(""); const [sort, setSort] = React.useState("Price low to high"); const toggle = (f) => setSelected(selected.includes(f) ? selected.filter((x) => x !== f) : [...selected, f]); const catOf = (c) => (window.CATEGORIES.find((x) => x.id === c.cat) || {}).label; const matches = (c) => selected.every((f) => f === "Automatic" ? c.gearbox === "Automatic" : f === "Diesel" ? c.fuel.indexOf("Diesel") > -1 : f === "Under ₹4,000" ? c.price < 4000 : catOf(c) === f); let cars = window.FLEET.filter((c) => matches(c) && (c.name + " " + c.marque).toLowerCase().indexOf(q.toLowerCase()) > -1); cars = cars.slice().sort((a, b) => sort === "Price high to low" ? b.price - a.price : sort === "Price low to high" ? a.price - b.price : 0); const compare = store.ids("compare").map((id) => window.FLEET.find((c) => c.id === id)).filter(Boolean); return ( setQ(e.target.value)} placeholder="Search a model" className="fc-search" />} />
{cars.map((c) => )}
{cars.length === 0 ?

Nothing matches those filters yet — widen the budget or clear a facet.

: null} {compare.length ? (
{compare.map((c) => ( {c.marque} {c.name} {window.rupees(c.price)} / day ))}
{compare.forEach ? null : null}
) : null}
); } Object.assign(window, { FleetScreen });