import * as AvatarPrimitive from "@radix-ui/react-avatar"; import * as Tooltip from "@radix-ui/react-tooltip"; import { Check } from "react-feather"; import classNames from "@calcom/lib/classNames"; import { defaultAvatarSrc } from "@calcom/lib/defaultAvatarImage"; import { Maybe } from "@trpc/server"; export type AvatarProps = { className?: string; size: "sm" | "lg"; imageSrc?: Maybe; title?: string; alt: string; gravatarFallbackMd5?: string; accepted?: boolean; }; export default function Avatar(props: AvatarProps) { const { imageSrc, gravatarFallbackMd5, size, alt, title } = props; const rootClass = classNames("rounded-full", props.size === "sm" ? "w-6" : "w-16", "h-auto"); const avatar = ( {gravatarFallbackMd5 && ( // eslint-disable-next-line @next/next/no-img-element {alt} )} {props.accepted && (
{size === "lg" && }
)}
); return title ? ( {avatar} {title} ) : ( <>{avatar} ); }