import { ChevronDownIcon, ChevronRightIcon } from 'lucide-react'; import { useState } from 'react'; import { Link } from '#/components/atoms/link.jsx'; import { CheckLog } from '#/components/molecules/check-log.jsx'; import { CheckRow } from '#/components/molecules/check-row.jsx'; import { CheckSteps } from '#/components/molecules/check-steps.jsx'; /** * One run as a line that opens in place: the steps it ran and the log behind * them. The log is fetched only once opened, so a commit checked by several * workflows costs one request per run the reader actually opens. * * A failed run opens itself. Someone reading a commit whose check failed came * for the output. */ export function CheckDisclosure({ runner, check, runHref }) { const failed = check.status === 'failure' || check.status === 'error'; const [open, setOpen] = useState(failed); const steps = Array.isArray(check.steps) ? check.steps : []; const Chevron = open ? ChevronDownIcon : ChevronRightIcon; return (