import { Avatar } from '#/components/atoms/avatar.jsx'; import { describeAuthor, initial } from '#/lib/authors.js'; import { identicon } from '#/lib/avatars.js'; import { cn } from '#/lib/utils.js'; /** * A commit author: their avatar and name, with the handle beside it when the * hosting account has claimed the ident. An unclaimed author shows the name * the commit carries and an initial in place of a picture. * * `avatar` false leaves the picture out, for a line of readings where the * name is one reading among several and a picture would set it apart from * the rest of them. */ export function AuthorLine({ ident, className, size = 'sm', avatar = true }) { const author = describeAuthor(ident); const box = size === 'md' ? 'size-6' : 'size-[18px]'; return ( {avatar && ( {initial(author.name)} } className={box} /> )} {author.name} {author.handle && ( @{author.handle} )} ); }