import { HistoryIcon } from 'lucide-react'; import { Link } from '#/components/atoms/link.jsx'; import { Skeleton } from '#/components/atoms/skeleton.jsx'; import { AuthorFacepile } from '#/components/molecules/author-facepile.jsx'; import { timeAgo } from '#/lib/format.js'; import { cn } from '#/lib/utils.js'; /** * The last commit to change the file in view, above it: who changed it, what * they said, and when. The repository's own latest commit reads the same way * above its file listing, so a reader meets one line in both places. * * The walk behind it runs over objects the file view has already opened, so * the line fills in behind the file rather than holding it up. */ /** * @param {{repo: string, commit?: {sha: string, message: string, author: unknown, committedAt: number}|null, pending?: boolean, historyHref?: string, className?: string}} props */ export function FileCommit({ repo, commit, pending, historyHref, className }) { // The placeholder stands in the shape of the line it waits for, down to // the round of the avatar, so the file below it does not step down the // page when the walk lands. if (pending) { return (