/* Shared components: Nav, Footer, Modal, helpers */
const { useState, useEffect, useRef, useMemo } = React;
// ===== Icons (minimal inline SVGs) =====
const Arrow = ({ size = 14 }) => (
);
const ArrowSmall = () => (
);
const LinkedinIcon = () => (
);
const PhoneIcon = () => (
);
const ChambersWordmark = () => (
Chambers
);
// ===== Logo (clean SVG, original — not the existing PNG mark) =====
const Logo = ({ light = false, compact = false }) => {
const fg = light ? '#FBFAF5' : '#16161A';
const accent = '#F2C744';
if (compact) {
return (
Horizons&Co
);
}
return (
Horizons& Co
);
};
// ===== Locale toggle =====
const LocaleToggle = ({ locale, setLocale }) => (
{['EN', 'AR', 'RU', 'ZH'].map(L => (
setLocale(L)}>{L}
))}
);
// ===== Nav =====
const Nav = ({ page, setPage, locale, setLocale, openConsult, t }) => {
const links = [
['home', t('navHome', 'Home')],
['practices', t('navPractices', 'Practices')],
['experts', t('navExperts', 'Experts')],
['insights', t('navInsights', 'Insights')],
['about', t('navAbout', 'About')],
['contact', t('navContact', 'Contact')],
];
return (
setPage('home')} style={{ background: 'transparent', border: 0, padding: 0 }}>
{links.map(([key, label]) => (
setPage(key)}>
{label}
))}
{t('cta', 'Request consultation')}
);
};
// ===== Footer =====
const Footer = ({ setPage }) => (
Horizons& Co
Established 1999. An Emirati-founded, disputes-focused full-service UAE law firm. Dubai HQ + Abu Dhabi.
© 1999–2026 Horizons & Co Law Firm LLC. All rights reserved.
);
// ===== Consultation Modal =====
const ConsultModal = ({ open, onClose, prefill }) => {
const [step, setStep] = useState('form');
const [data, setData] = useState({ name: '', email: '', phone: '', practice: prefill?.practice || '', message: '' });
useEffect(() => {
if (open) { setStep('form'); setData(d => ({ ...d, practice: prefill?.practice || d.practice })); }
}, [open, prefill]);
useEffect(() => {
const onKey = e => { if (e.key === 'Escape' && open) onClose(); };
window.addEventListener('keydown', onKey);
return () => window.removeEventListener('keydown', onKey);
}, [open, onClose]);
const submit = e => {
e.preventDefault();
setStep('success');
};
return (
e.stopPropagation()}>
{step === 'form' ? <>
Confidential enquiry
Request a consultation.
An institutional enquiry channel. We will reply within one business day, in your preferred language, with the most appropriate partner for the matter.
No fee disclosed
Legal-privilege observed
EN · AR · RU · ZH
> : (
Enquiry received.
Thank you, {data.name?.split(' ')[0] || 'we'}. Our team will reply within one business day with the most appropriate partner for {data.practice ? PRACTICES.find(p=>p.id===data.practice)?.title || 'your matter' : 'your matter'}.
Close
)}
);
};
// ===== Practice Card =====
const PracticeCard = ({ p, onClick, locale }) => (
{p.num}
{locale === 'AR' ? p.ar : p.title}
{p.blurb}
);
// ===== Expert Card =====
const ExpertCard = ({ e, onClick }) => (
{e.placeholder ?
:
}
);
const PortraitPlaceholder = ({ name }) => {
const initials = (name || '').split(/\s+/).filter(w => w[0] && /[A-Za-z]/.test(w[0])).slice(0, 2).map(w => w[0]).join('').toUpperCase();
return (
Awaiting portrait
{initials}
);
};
// ===== Insight Card =====
const InsightCard = ({ i, small, onClick }) => (
{i.cat}
{i.title}
{i.date} · {i.practice}
);
// ===== Section Head =====
const SectionHead = ({ eyebrow, title, lede, action }) => (
{eyebrow}
{title}
{lede ?
{lede}
: null}
{action ?
{action}
: null}
);
// ===== Award card =====
const AwardCard = ({ a }) => (
{a.yr}
{a.issuer}
{a.band}
{a.cat}
);
// ===== Map plate (stylised, no real coords — brief says don't guess) =====
const MapPlate = ({ city }) => (
{/* abstracted street lines */}
{/* pin */}
{city.toUpperCase()}
coordinates to confirm
);
// Translation helper (very small dictionary)
const makeT = (locale) => (key, fallback) => {
if (locale === 'AR' && AR[key]) return AR[key];
return fallback;
};
Object.assign(window, {
Arrow, ArrowSmall, LinkedinIcon, PhoneIcon, ChambersWordmark,
Logo, LocaleToggle, Nav, Footer, ConsultModal,
PracticeCard, ExpertCard, PortraitPlaceholder, InsightCard, SectionHead,
AwardCard, MapPlate, makeT,
});