// sections.jsx — page composition for the AHS Properties project microsite.
// Loaded after data.js, React/Babel/ReactDOM, and modals.jsx.
const { useState, useEffect, useRef, useMemo } = React;
// Tiny utilities ─────────────────────────────────────────────────────────────
function Eyebrow({ children, light }) {
return {children};
}
function MultilineText({ value }) {
return <>{value.split('\n').map((line, i) => {i > 0 &&
}{line})}>;
}
// Navbar ─────────────────────────────────────────────────────────────────────
function Navbar({ lang, setLang, copy, onOpen }) {
const [solid, setSolid] = useState(false);
useEffect(() => {
const onScroll = () => setSolid(window.scrollY > 80);
window.addEventListener('scroll', onScroll, { passive: true });
return () => window.removeEventListener('scroll', onScroll);
}, []);
const LANGS = [['en','EN'],['ar','عر'],['ru','RU'],['zh','中']];
return (
);
}
// Hero ───────────────────────────────────────────────────────────────────────
function Hero({ project, copy, onOpen }) {
const ref = useRef(null);
useEffect(() => {
if (!ref.current) return;
let raf = null;
const onScroll = () => {
if (raf) return;
raf = requestAnimationFrame(() => {
const y = window.scrollY;
if (ref.current) ref.current.style.transform = `scale(1.06) translateY(${y * 0.18}px)`;
raf = null;
});
};
window.addEventListener('scroll', onScroll, { passive: true });
return () => window.removeEventListener('scroll', onScroll);
}, [project.slug]);
return (
{project.statusLabel[copy._lang] || project.statusLabel.en}
{project.eyebrow}
{project.tagline[copy._lang] || project.tagline.en}
{copy.hero.scroll}
);
}
// Project rail — sub-nav under hero ─────────────────────────────────────────
function ProjectRail({ project, copy, onOpen }) {
return (
{copy.rail.breadcrumbProjects}
/
{project.name}
);
}
// Overview ───────────────────────────────────────────────────────────────────
function Overview({ project, copy }) {
return (
{copy.sections.overview}
{project.name === 'Casa Canal' && (copy._lang === 'en' ? <>The canal,
in residence.> : )}
{project.name === 'Casa AHS' && (copy._lang === 'en' ? <>Thirty-two
rare addresses.> : )}
{project.name === 'One Crescent' && (copy._lang === 'en' ? <>The Palm,
at one stroke.> : )}
{project.name === 'One Canal' && (copy._lang === 'en' ? <>The canal,
by Fendi.> : )}
{project.tagline[copy._lang] || project.tagline.en}
{project.overview[copy._lang] || project.overview.en}
Prices ·
By enquiry. AHS Properties does not headline prices. Per-unit DLD records are referenced privately with verified buyers only.
{project.facts.map((f, i) => (
{f.k}
{f.v}{f.sub && {f.sub}}
{f.note}
))}
);
}
// Location — map + amenities list ────────────────────────────────────────────
function Location({ project, copy }) {
return (
{/* Stylised map — placeholder for Google output=embed at build */}
{project.name}
{copy.sections.location}
{copy.location.neighborhood} · {project.location.neighborhood}
{project.location.proximities.map((p, i) => (
{p.name}
{p.dist}
))}
Indicative distances · interactive map activated at build (Google output=embed).
);
}
// Partners ───────────────────────────────────────────────────────────────────
function Partners({ project, copy }) {
return (
{copy.sections.design}
{copy.partners.sub}
{project.partners.map((p, i) => (
{p.role}
))}
);
}
// Residences ─────────────────────────────────────────────────────────────────
function Residences({ project, copy, onOpen }) {
return (
{copy.sections.residences}
{copy.residences.sub}
{project.residences.map((r, i) => (
onOpen('register')}>
{r.idx}
{r.name}
{r.desc}
{r.meta}{r.sub}
))}
Email-gated · floor concepts · partner credits
);
}
function Arrow({ inverted }) {
return (
);
}
// Amenities ─────────────────────────────────────────────────────────────────
function Amenities({ project, copy }) {
return (
{copy.sections.amenities}
{project.amenities.map((a, i) => (
))}
);
}
// Gallery ───────────────────────────────────────────────────────────────────
function Gallery({ project, copy, onLightbox }) {
return (
{copy.sections.gallery}
{project.gallery.length} images · click to enlarge. Film and high-resolution stills available on enquiry.
{project.gallery.map((g, i) => (
onLightbox(i)}
onKeyDown={(e) => (e.key === 'Enter' || e.key === ' ') && onLightbox(i)}
aria-label={g.label}
>
))}
);
}
// Founder ───────────────────────────────────────────────────────────────────
function Founder({ copy }) {
return (
{copy.founder.eyebrow}
{copy.founder.title}
{copy.founder.quote}
{copy.founder.attr}
{copy.founder.body}
);
}
// Press strip ───────────────────────────────────────────────────────────────
function Press({ copy }) {
return (
{copy.press.heading}
Forbes
Bloomberg
Businesswire
Entrepreneur
Luxury Lifestyle Awards 2024
Awards and press names referenced. AHS Properties: Top 100 Luxury Real Estate Developers of the World 2024 (Luxury Lifestyle Awards).
);
}
// CTA band ──────────────────────────────────────────────────────────────────
function CTABand({ copy, onOpen }) {
return (
);
}
// Footer ────────────────────────────────────────────────────────────────────
function Footer({ copy }) {
return (
);
}
// WhatsApp FAB ──────────────────────────────────────────────────────────────
function WhatsAppFab({ onOpen }) {
return (
);
}
Object.assign(window, {
Navbar, Hero, ProjectRail, Overview, Location, Partners, Residences,
Amenities, Gallery, Founder, Press, CTABand, Footer, WhatsAppFab, Arrow,
Eyebrow, MultilineText,
});