import { useId, useState } from "react"; import ArrowLink from "../../components/ArrowLink.tsx"; import { orgLogo } from "../../lib/media.ts"; import PlatformIcon from "../../components/PlatformIcon.tsx"; import { areasSentence, initialsFor, orgPath, useOrganizations, byName, } from "../../lib/organizations.ts"; /* ═══════════════════════════════════════════════════════════════ ORGANIZATION LIST: VERTICAL A stack of organizations, each collapsed to a line and expandable for the rest. Every row carries two ways out: an arrow through to that organization's page on this site, and a labelled button out to its own site when it has one. Nothing here is region-specific. It asks for a kind and renders what comes back, so the same section lists partners or chapters by changing one prop: org.details?.scope} /> Kind-specific extras (the areas a region covers, the chapters inside it) come from `details` and render only when present, so a partner row simply doesn't have them. ═══════════════════════════════════════════════════════════════ */ const MUTED = "#7a9299"; const RULE = "#cfe3e7"; const INK = "#2c4a50"; const FALLBACK_COLOR = "#4a6b72"; /* ── Row button ─────────────────────────────────────────────── Deliberately a sibling of the summary button rather than inside it, a link nested in a button is invalid, and a screen reader announces the whole row as one confused control. ───────────────────────────────────────────────────────────── */ function RowButton({ as: As = "button", color, children, ...rest }: any) { return ( {children} ); } function OrgMark({ org, color }) { const [failed, setFailed] = useState(false); if (org.logo && !failed) { return ( setFailed(true)} className="h-8 w-8 object-contain shrink-0" /> ); } if (org.color) { return (