import { ArrowUpRight } from '@phosphor-icons/react';
import { Link } from "react-router-dom";
import ArrowLink from "../../components/ArrowLink.tsx";
import OrgLogo from "../../components/OrgLogo.tsx";
import {
orgPath,
useOrganizations,
byName,
} from "../../lib/organizations.ts";
import { accentText } from '../../lib/color.ts'
import { useReadingMode } from '../../lib/readingMode.ts'
/* ═══════════════════════════════════════════════════════════════
ORGANIZATION LIST: CARDS
A grid of organization cards. No toggle: this view is the grid,
which is why the section that uses it declares no `views` in the
page manifest and gets no control in its heading.
Where the vertical list expands in place, a card links out. The
card carries as much as fits at a glance and the organization's
own page carries the rest, so nothing here reads a `blocks`
array, only the short card description.
═══════════════════════════════════════════════════════════════ */
const MUTED = "var(--color-muted)";
const INK = "var(--color-body)";
const FALLBACK_COLOR = "#3b5456";
/* Wide enough for a logo beside two lines of text, narrow enough
that three fit on a laptop. The grid drops a column rather than
squeezing below this. */
const CARD_MIN = "20rem";
const GRID_MAX = "88rem";
/* Under a block title the card names are a level below it. */
function OrgCard({ org, accent, pageLabel, siteLabel, titled }) {
const color = org.color || accent;
const path = orgPath(org);
const reading = useReadingMode();
const Name = titled ? "h4" : "h3";
// Tagline first, then where they are. Partners often have one and
// not the other, so this is the line that's most likely to say
// something useful.
const subtitle = org.tagline || org.location_label;
return (
{path ? {org.name} : org.name}
{subtitle && (
{subtitle}
)}
{/* Top-right rather than in the footer: the footer holds
outbound links, and the arrow goes somewhere different
in kind, deeper into this site. Reading mode has the
name's link and leaves it out. */}
{path && !reading && (
)}
{org.description?.length > 0 && (
{org.description[0]}
)}
{/* mt-auto pins the footer so buttons line up across a row
however much text each card carries. */}