@props([
'url' => null,
'initial' => '?',
'size' => 'md',
])
@php
$sizeClass = match ($size) {
'sm' => 'h-8 w-8 text-xs',
'lg' => 'h-12 w-12 text-base',
default => 'h-10 w-10 text-sm',
};
@endphp
@if ($url)
merge(['class' => "shrink-0 rounded-full object-cover ring-1 ring-gray-200 {$sizeClass}"]) }}
src="{{ $url }}"
alt=""
/>
@else
merge(['class' => "inline-flex shrink-0 items-center justify-center rounded-full bg-gray-200 font-semibold text-gray-600 ring-1 ring-gray-200 {$sizeClass}"]) }}
aria-hidden="true"
>{{ $initial }}
@endif