/* global React */
// ============================================================
// Espace — shared UI atoms
// ============================================================
// Render a headline array that may contain {em: "italic part"} fragments
function HeadlineFragments({ parts }) {
return parts.map((p, i) => {
if (typeof p === "string") return {p === " " ? "\u00A0" : p + " "} ;
if (p && p.em) return {p.em} ;
return null;
});
}
function Arrow({ size = 14 }) {
return (
);
}
function ArrowDown({ size = 14 }) {
return (
);
}
function WhatsAppIcon({ size = 16 }) {
return (
);
}
function PinIcon({ size = 16 }) {
return (
);
}
function PhoneIcon({ size = 14 }) {
return (
);
}
function VideoIcon({ size = 14 }) {
return (
);
}
function BedIcon({ size = 14 }) {
return (
);
}
function BathIcon({ size = 14 }) {
return (
);
}
function AreaIcon({ size = 14 }) {
return (
);
}
// ── Navbar ────────────────────────────────────────────────────
function Navbar({ route, setRoute, locale, setLocale }) {
return (
setRoute({ name: "home" })} style={{ cursor: "pointer" }}>
setRoute({ name: "communities" })}>Communities
setRoute({ name: "communities" })}>Buy
setRoute({ name: "sell" })}>Sell
setRoute({ name: "communities" })}>Rent
setRoute({ name: "team" })}>Team
setRoute({ name: "contact" })}>Contact
{["EN","AR","RU","ZH"].map(L => (
setLocale(L)}>{L}
))}
setRoute({ name: "sell" })}>
Book a viewing
);
}
// ── WhatsApp FAB ──────────────────────────────────────────────
function WhatsAppFab() {
const msg = encodeURIComponent("Hi Espace, I'd like to book a viewing for …");
return (
WhatsApp us
);
}
// ── Ticker ────────────────────────────────────────────────────
function Ticker({ items }) {
// double the list for seamless loop
const doubled = [...items, ...items];
return (
{doubled.map((t, i) => (
{t}
))}
);
}
// ── Section header ────────────────────────────────────────────
function SecHead({ eyebrow, headlineParts, lead, rightMeta }) {
return (
{eyebrow}
{lead &&
{lead}
}
{rightMeta &&
{rightMeta}
}
);
}
// ── Breadcrumbs ───────────────────────────────────────────────
function Crumbs({ items }) {
return (
{items.map((it, i) => (
{i > 0 && / }
{it.onClick ? {it.label} : {it.label} }
))}
);
}
// ── Footer ────────────────────────────────────────────────────
function Footer({ setRoute }) {
return (
An award-winning Dubai brokerage, built on traditional UK estate-agency standards since 2009.
Full-service across sales, leasing and property management.
© 2009–{new Date().getFullYear()} Espace Real Estate · Mon–Fri 9am–6pm
);
}
Object.assign(window, {
HeadlineFragments, Arrow, ArrowDown, WhatsAppIcon, PinIcon, PhoneIcon, VideoIcon,
BedIcon, BathIcon, AreaIcon,
Navbar, WhatsAppFab, Ticker, SecHead, Crumbs, Footer,
});