import { Link } from '#/components/atoms/link.jsx'; import { CheckRow } from '#/components/molecules/check-row.jsx'; import { checkLook, latestPerWorkflow, summarize, summaryWords, } from '#/lib/checks.js'; import { shortRef } from '#/lib/git.js'; import { cn } from '#/lib/utils.js'; /** * One commit's runs, as a card: a heading that names the commit on the bright * surface, and the runs under it on the recessed one, so a page of them reads * as blocks rather than one unbroken sheet. * * A sha names nothing to a reader, so the heading reads as the commit's * subject line once the repository is open, and as the short sha until then. * The heading's status covers the commit: the newest run of each workflow * decides it, so a workflow asked for twice counts once. */ export function CheckGroup({ repo, group, label }) { const summary = summarize(latestPerWorkflow(group.runs)); const look = checkLook(summary?.status); const commitHref = `/${encodeURIComponent(repo)}/commit/${group.sha}`; const short = group.sha.slice(0, 8); const ref = group.runs.find((run) => run.ref)?.ref; return (
{short}
)}
{ref && (
{shortRef(ref)}
)}