mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-03 00:19:03 +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 (
|
||||
<Avatar className={className} style={{ width: size, height: size }}>
|
||||
{src ? (
|
||||
src.startsWith("http") ? (
|
||||
<AvatarImage src={src} alt={name} />
|
||||
) : (
|
||||
<Image
|
||||
src={getAvatarUrl(src)}
|
||||
width={128}
|
||||
height={128}
|
||||
alt={name}
|
||||
style={{ objectFit: "cover" }}
|
||||
objectFit="cover"
|
||||
/>
|
||||
)
|
||||
{!src || src.startsWith("https") ? (
|
||||
<AvatarImage src={src} alt={name} />
|
||||
) : (
|
||||
<AvatarFallback>{name[0]}</AvatarFallback>
|
||||
<Image
|
||||
src={getAvatarUrl(src)}
|
||||
width={128}
|
||||
height={128}
|
||||
alt={name}
|
||||
style={{ objectFit: "cover" }}
|
||||
/>
|
||||
)}
|
||||
<AvatarFallback>{name[0]}</AvatarFallback>
|
||||
</Avatar>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue