import { HistoryIcon } from 'lucide-react'; import { Link } from '#/components/atoms/link.jsx'; import { AuthorFacepile } from '#/components/molecules/author-facepile.jsx'; import { RefCheckStatus } from '#/components/molecules/ref-check-status.jsx'; import { timeAgo } from '#/lib/format.js'; /** * The commit at the tip of the ref in view, above the file listing: who wrote * it, what it said, how its checks ended, and how far the history goes. * * The count comes from the same walk that produced the commit, so it is the * number of commits reachable from this ref rather than a total for the * repository. A walk that hit its ceiling reads as "N+". It is the only route * to the history from this page. */ export function LatestCommit({ repo, refName, commit, count, truncated, space, }) { const subject = commit.message.split('\n')[0]; const short = commit.sha.slice(0, 7); return (
{subject} {short} {timeAgo(commit.committedAt)} {count} {truncated ? '+' : ''} {count === 1 && !truncated ? 'commit' : 'commits'}
); }