@props([
'user',
'size' => 'md',
])
@php
$sizeClass = match($size) {
'sm' => 'w-8 h-8 text-xs',
'lg' => 'w-16 h-16 text-xl',
default => 'w-10 h-10 text-sm',
};
$initials = collect(explode(' ', trim($user->full_name ?? '')))
->filter()
->take(2)
->map(fn ($part) => substr($part, 0, 1))
->join('');
$initials = strtoupper($initials ?: 'U');
@endphp
@if($user->avatar_url)
merge(['class' => "rounded-full object-cover shrink-0 {$sizeClass}"]) }}
/>
@else