Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/components/common/CreatorInitialsAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,31 @@ const CreatorInitialsAvatar: React.FC<CreatorInitialsAvatarProps> = ({
if (!imageSrc || hasError) {
return (
<div
role="img"
aria-label={`${name} avatar`}
className={cn(
'flex size-full items-center justify-center text-3xl font-black tracking-wide',
'flex size-full flex-col items-center justify-center gap-0.5 text-3xl font-black tracking-wide',
className
)}
style={{
background: fallbackColors.background,
color: fallbackColors.textColor,
}}
>
<span aria-label={`${name} initials avatar`}>{initials}</span>
<span aria-hidden="true">{initials}</span>
{hasError && (
<span className="text-[0.5rem] font-semibold uppercase tracking-widest opacity-60">
No image
</span>
)}
</div>
);
}

return (
<img
src={imageSrc}
alt={name}
alt={`${name} avatar`}
onError={() => setHasError(true)}
className={cn('size-full object-cover', imageClassName, className)}
/>
Expand Down