/* global React */
const { useState, useEffect, useRef, useMemo, useCallback } = React;
// ─── Logo ──────────────────────────────────────────────────────────────
function BsaLogo({ height = 36, color = "currentColor" }) {
// The SVG wordmark already contains "BSA LAW" — render it alone, no duplicated text.
return (
);
}
// ─── Section header ───────────────────────────────────────────────────
function SectionHead({ eyebrow, head, sub, align = "left", maxw = 740, onDark }) {
return (
{eyebrow &&
{eyebrow}
}
{head}
{sub && (
{sub}
)}
);
}
// ─── Icons (minimal hairline) ─────────────────────────────────────────
const I = {
arrow: (p) => ,
arrowSm: (p) => ,
close: (p) => ,
plus: (p) => ,
chev: (p) => ,
globe: (p) => ,
search: (p) => ,
email: (p) => ,
phone: (p) => ,
pin: (p) => ,
scroll: (p) => ,
linkedin: (p) => ,
};
// ─── Modal ────────────────────────────────────────────────────────────
function Modal({ open, onClose, children, side = "right" }) {
useEffect(() => {
if (!open) return;
const prev = document.body.style.overflow;
document.body.style.overflow = "hidden";
const esc = (e) => e.key === "Escape" && onClose();
window.addEventListener("keydown", esc);
return () => { document.body.style.overflow = prev; window.removeEventListener("keydown", esc); };
}, [open, onClose]);
if (!open) return null;
return (
{children}
);
}
// ─── Enquiry Form ─────────────────────────────────────────────────────
function EnquiryForm({ presetLawyer, presetPractice, presetOffice, t }) {
const [submitted, setSubmitted] = useState(false);
const [form, setForm] = useState({
name: "",
org: "",
email: "",
phone: "",
practice: presetPractice || "",
lawyer: presetLawyer || "",
office: presetOffice || "",
message: "",
consent: false,
});
const set = (k) => (e) => setForm((f) => ({ ...f, [k]: e.target.type === "checkbox" ? e.target.checked : e.target.value }));
const submit = (e) => { e.preventDefault(); setSubmitted(true); };
if (submitted) {
return (
Received
Thank you.
Your enquiry has been routed to the appropriate partner. We typically respond within one business day.
);
}
return (
);
}
// ─── Lawyer card ──────────────────────────────────────────────────────
function LawyerCard({ p, onOpen, t }) {
return (
onOpen(p)}>

e.currentTarget.style.transform = "scale(1.03)"}
onMouseLeave={(e) => e.currentTarget.style.transform = "scale(1)"}
/>
{p.credentials.find((c) => c.toLowerCase().includes("chambers") || c.toLowerCase().includes("legal 500")) && (
Ranked
)}
{p.name}
{p.role} · {p.office}
{p.practices.slice(0, 2).join(" · ")}
);
}
// ─── Lawyer detail panel (inside modal) ───────────────────────────────
function LawyerDetail({ p, onClose, onEnquire, t }) {
return (
{p.role} · {p.office}
{p.name}
{p.practices.map((pr) => {pr})}
{p.bio}
{p.credentials.length > 0 && (
Credentials
{p.credentials.map((c, i) => (
-
{String(i + 1).padStart(2, "0")}
{c}
))}
)}
);
}
Object.assign(window, { BsaLogo, SectionHead, I, Modal, EnquiryForm, LawyerCard, LawyerDetail });