mirror of
https://github.com/shadcn-ui/taxonomy
synced 2026-05-24 09:48:32 +00:00
fix: issue with avatar when empty
This commit is contained in:
parent
493b5c3b50
commit
5306baf3f4
1 changed files with 6 additions and 0 deletions
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Reference in a new issue