@props([ 'user' => null, 'size' => 40, 'subtitle' => null, 'nameClass' => 'fw-semibold', 'stacked' => false, ]) @php $photoUrl = $user?->profile_photo_path ? asset('storage/' . $user->profile_photo_path) : null; $userInitial = $user?->name ? strtoupper(mb_substr($user->name, 0, 1)) : 'U'; $avatarSize = (int) $size; @endphp
merge(['class' => $stacked ? 'd-inline-flex flex-column align-items-start gap-1' : 'd-inline-flex align-items-center gap-2']) }}>
@if ($photoUrl) Foto profil {{ $user?->name ?? 'user' }} @else {{ $userInitial }} @endif
{{ $user?->name ?? '-' }}
@if (!is_null($subtitle))
{{ $subtitle }}
@endif