import { ClockIcon, DatabaseIcon, GitBranchIcon, TagIcon } from 'lucide-react';
import { Contributors } from '#/components/molecules/contributors.jsx';
import { RepoGauges } from '#/components/molecules/repo-gauges.jsx';
import { bytes, timeAgo } from '#/lib/format.js';
import { branchRefs, repoSize, tagRefs } from '#/lib/git.js';
/** One fact about the repository: an icon, a number, and what it counts. */
function Fact({ Icon, value, label }) {
return (
{value}
{label}
);
}
/**
* What the repository is, beside its files: the description, what it is
* written in and how lately it was worked on, and what it holds. The column
* a forge calls About. It reads once, at the root; inside a directory the
* listing pane carries the gauges instead.
* @param {{record: Record, repo: string, refName: string, space?: string}} props
*/
export function RepoAbout({ record, repo, refName, space }) {
const branches = branchRefs(record).length;
const tags = tagRefs(record).length;
const description =
typeof record.description === 'string' ? record.description : '';
const updatedAt =
typeof record.updatedAt === 'string' ? record.updatedAt : '';
return (
About
{description || No description.}
{tags > 0 && (
)}
{updatedAt && (
)}
);
}