import type { AvatarProps } from './avatar' import Image from '../Image/Image.tsx' import { classNames } from '../../utils/classNames' import styles from './avatar.module.scss' export type Props = AvatarProps const Avatar = ({ img, alt = 'Avatar', size = 40, lazy = true, borderColor, borderless, reverse, className, groupClassName }: Props) => { const classes = classNames([ styles.avatar, borderless && styles.borderless, className ]) const groupStyles = classNames([ styles.group, reverse && styles.reverse, groupClassName ]) const borderColorStyle = borderColor ? { '--w-avatar-border': borderColor } as React.CSSProperties : undefined return Array.isArray(img) ? (
{img.map((img, index) => ( {Array.isArray(alt) ))}
) : ( {Array.isArray(alt) ) } export default Avatar