mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-06 09:59:00 +02:00
🐛 Fix fallback image
This commit is contained in:
parent
4cdc409b8d
commit
322f4c5261
1 changed files with 10 additions and 14 deletions
|
@ -24,22 +24,18 @@ export const OptimizedAvatarImage = ({
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<Avatar className={className} style={{ width: size, height: size }}>
|
<Avatar className={className} style={{ width: size, height: size }}>
|
||||||
{src ? (
|
{!src || src.startsWith("https") ? (
|
||||||
src.startsWith("http") ? (
|
<AvatarImage src={src} alt={name} />
|
||||||
<AvatarImage src={src} alt={name} />
|
|
||||||
) : (
|
|
||||||
<Image
|
|
||||||
src={getAvatarUrl(src)}
|
|
||||||
width={128}
|
|
||||||
height={128}
|
|
||||||
alt={name}
|
|
||||||
style={{ objectFit: "cover" }}
|
|
||||||
objectFit="cover"
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
) : (
|
) : (
|
||||||
<AvatarFallback>{name[0]}</AvatarFallback>
|
<Image
|
||||||
|
src={getAvatarUrl(src)}
|
||||||
|
width={128}
|
||||||
|
height={128}
|
||||||
|
alt={name}
|
||||||
|
style={{ objectFit: "cover" }}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
|
<AvatarFallback>{name[0]}</AvatarFallback>
|
||||||
</Avatar>
|
</Avatar>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue