/* ═══════════════════════════════════════════════════════════════ ORG CONTACT An organization's ways to reach it, as buttons: its action links filled in its accent, then its website, email and socials outlined. Nothing at all when it has none. Used on an organization's page and on the Organization page (NGU's own). ═══════════════════════════════════════════════════════════════ */ import PlatformIcon from './PlatformIcon.tsx' import type { OrganizationRecord } from '../lib/useContent.ts' import { accentText } from '../lib/color.ts' export default function OrgContact({ org, accent }: { org: OrganizationRecord; accent: string }) { const hasAny = org.links.length > 0 || org.socials.length > 0 || org.website || org.email if (!hasAny) return null return (
{org.links.map((link) => ( {link.label} ))} {/* website and email arrive as bare strings (splitLinks in shape.js); socials are whole link rows. */} {[ org.website ? { url: org.website, label: 'Website', platform: null } : null, org.email ? { url: `mailto:${org.email}`, label: org.email, platform: null } : null, ...org.socials, ] .filter((link): link is NonNullable => Boolean(link)) .map((link) => ( {link.label} ))}
) }