import * as AvatarPrimitive from "@radix-ui/react-avatar";
import * as Tooltip from "@radix-ui/react-tooltip";
import { defaultAvatarSrc } from "@lib/profile";
import classNames from "@lib/classNames";
export type AvatarProps = {
className?: string;
size: number;
imageSrc?: string;
title?: string;
alt: string;
gravatarFallbackMd5?: string;
};
export default function Avatar({ imageSrc, gravatarFallbackMd5, size, alt, title, ...props }: AvatarProps) {
const className = classNames(
"border-2 border-gray-300 rounded-full",
props.className,
`h-${size} w-${size}`
);
const avatar = (
{gravatarFallbackMd5 && (
)}
);
return title ? (
{avatar}
{title}
) : (
<>{avatar}>
);
}