import { Avatar } from '#/components/atoms/avatar.jsx'; import { Count } from '#/components/atoms/count.jsx'; import { describeAuthor, initial } from '#/lib/authors.js'; import { identicon } from '#/lib/avatars.js'; import { useHistory } from '#/lib/source.js'; /** How many faces show before the rest are counted. */ const FACES = 14; /** * Everyone the history credits, as a row of faces beside the files, the way * a forge lists a repository's contributors. Each face carries its name and * its count in the title. An author the account has claimed wears their * profile; anyone else keeps the initial of the name the commit carries. * * The count is read from the same history walk the gauges read, so it costs * no read of its own. * @param {{repo: string, refName: string, space?: string}} props */ export function Contributors({ repo, refName, space }) { const { data: history } = useHistory(repo, refName, space); const authors = history?.authors ?? []; if (authors.length === 0) return null; const shown = authors.slice(0, FACES); return (
+ {authors.length - shown.length} more
)}