import { Link } from "@tanstack/react-router"; import { Avatar } from "~/ui/Avatar"; import { cn } from "~/utils/cn"; type Props = { authorName: string; /** The account that verified the commit's author email, if any. */ authorAccount: string | null; avatar?: boolean; className?: string; }; /** * A commit author: linked to their profile (with hovercard) when the commit email belongs to a verified * address on an account, otherwise the raw git name with a generated lava lamp, never someone else's picture. */ export function CommitAuthor({ authorName, authorAccount, avatar = true, className }: Props) { if (!authorAccount) { return ( {avatar && } {authorName} ); } return ( {avatar && } {authorAccount} ); }