feat: add client-side onerror fallback to default avatar
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
$deptName = $deptVal ?? 'Team';
|
||||
}
|
||||
@endphp
|
||||
<img src="{{ $avatarUrl }}" alt="Avatar" class="w-full h-full object-cover">
|
||||
<img src="{{ $avatarUrl }}" alt="Avatar" class="w-full h-full object-cover" onerror="this.onerror=null; this.src='{{ asset('images/avatar.png') }}';">
|
||||
</div>
|
||||
<div class="hidden sm:flex flex-col leading-tight pr-1">
|
||||
<span class="text-[13px] font-bold text-[#1a2b49] block truncate max-w-[100px]" title="{{ Auth::user()->name }}">{{ Auth::user()->name }}</span>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
<!-- Avatar & Info -->
|
||||
<div class="flex items-center gap-3 ml-1 min-w-0 flex-1">
|
||||
<img src="{{ $avatar }}" alt="{{ $name }}" class="w-10 h-10 rounded-full object-cover shadow-sm border border-gray-100 flex-shrink-0">
|
||||
<img src="{{ $avatar }}" alt="{{ $name }}" class="w-10 h-10 rounded-full object-cover shadow-sm border border-gray-100 flex-shrink-0" onerror="this.onerror=null; this.src='{{ asset('images/avatar.png') }}';">
|
||||
<div class="flex flex-col min-w-0 flex-1">
|
||||
<span class="text-[14px] font-bold {{ $isCurrent ? 'text-[#1a2b49]' : 'text-gray-800' }} leading-tight mb-0.5 truncate">{{ $name }}</span>
|
||||
<span class="text-[12px] text-gray-500 font-medium truncate" title="{{ $team }}">{{ $team }}</span>
|
||||
|
||||
Reference in New Issue
Block a user