@props(['call']) @php use App\Support\CallLogKind; $kind = CallLogKind::resolve($call); $duration = CallLogKind::formatDuration($call->duration !== null ? (int) $call->duration : null); $styles = match ($kind) { CallLogKind::OUTGOING => ['bg' => '#dbeafe', 'color' => '#1d4ed8', 'label' => __('devices.calls.type_outgoing')], CallLogKind::MISSED => ['bg' => '#fee2e2', 'color' => '#b91c1c', 'label' => __('devices.calls.type_missed')], CallLogKind::ANSWERED => ['bg' => '#dcfce7', 'color' => '#15803d', 'label' => __('devices.calls.type_answered')], default => ['bg' => '#f1f5f9', 'color' => '#475569', 'label' => __('devices.calls.type_unknown')], }; @endphp
merge(['class' => 'inline-flex items-center gap-1.5']) }} title="{{ $styles['label'] }}"> @if($kind === CallLogKind::OUTGOING) @elseif($kind === CallLogKind::MISSED) @elseif($kind === CallLogKind::ANSWERED) @else @endif {{ $styles['label'] }} @if(in_array($kind, [CallLogKind::ANSWERED, CallLogKind::OUTGOING], true) && $duration) ยท {{ $duration }} @endif