/* Aerovista — shared components */
const { useState, useEffect, useRef, useMemo } = React;
const D = window.AV_DATA;
/* ------ Brand logo (inline SVG, recoloured to currentColor) ------ */
function Logo({ color = "var(--brand)", height = 22 }) {
// Use the file logo; color is applied via filter or stays as native red.
return (
);
}
/* ------ Tiny right arrow glyph ------ */
const Arr = ({ small } = {}) => (
{small ? "→" : "→"}
);
/* ------ Nav ------ */
function Nav({ page, setPage, onEnquire, lang, setLang, onDark }) {
const t = D.i18n[lang];
const pages = [
{ id: "services", label: t.nav[0] },
{ id: "fleet", label: t.nav[1] },
{ id: "group", label: t.nav[2] },
{ id: "news", label: t.nav[3] },
{ id: "contact", label: t.nav[4] },
];
return (
);
}
/* ------ Footer ------ */
function Footer({ setPage }) {
return (
);
}
/* ------ Enquiry Modal ------ */
function EnquiryModal({ open, onClose, prefill }) {
const [tab, setTab] = useState(prefill || "leasing");
const [sent, setSent] = useState(false);
useEffect(() => {
if (prefill) setTab(prefill);
if (open) setSent(false);
}, [open, prefill]);
useEffect(() => {
const h = (e) => { if (e.key === "Escape") onClose(); };
if (open) window.addEventListener("keydown", h);
return () => window.removeEventListener("keydown", h);
}, [open, onClose]);
if (!open) return null;
const types = [
["leasing", "Leasing"],
["trading", "Trading"],
["management", "Management"],
["engineering", "Engineering"],
["general", "General"],
];
return (
● Enquiry · {tab.toUpperCase()}
Let's do business.
Routed to {D.contact.salesEmail}
{sent ? (
● Received
Thank you.
Your enquiry is in. The Dubai office acknowledges B2B enquiries within one business day.
{D.contact.phone} · {D.contact.salesEmail}
) : (
<>
Enquiry type
{types.map(([id, label]) => (
))}
>
)}
);
}
/* ------ Floating Action ------ */
function FAB({ onClick, label }) {
return (
);
}
/* ------ Marquee ------ */
function Marquee({ items }) {
const doubled = [...items, ...items];
return (
{doubled.map((x, i) => {x})}
);
}
/* ------ Stat strip ------ */
function StatStrip({ stats }) {
return (
{stats.map((s, i) => (
))}
);
}
/* expose */
Object.assign(window, { Logo, Arr, Nav, Footer, EnquiryModal, FAB, Marquee, StatStrip });