fix: issue with avatar when empty

This commit is contained in:
shadcn 2022-11-30 19:33:16 +04:00
parent 493b5c3b50
commit 5306baf3f4

View file

@ -18,14 +18,20 @@ export function Avatar({ className, ...props }: AvatarProps) {
}
Avatar.Image = function AvatarImage({
src,
className,
alt,
width = 32,
height = 32,
...props
}: ImageProps) {
if (!src) {
return <Avatar.Fallback />
}
return (
<Image
src={src}
className={cn("", className)}
alt={alt}
width={width}