import cx from "classnames"; import type { HTMLAttributes } from "react"; import React from "react"; import { Icon } from "../Icon"; const CLASS_ROOT = "avatar"; export interface AvatarProps extends HTMLAttributes { alt?: string; iconName?: string; src: string; } export const Avatar: React.FC = ({ alt = "", className, iconName, src, ...other }) => { const hasDecoration = Boolean(iconName); const classes = cx(CLASS_ROOT, className); return (
{hasDecoration && ( )} {alt}
); }; Avatar.displayName = "Avatar";