@section('title', __('Incidents'))
{{-- abrir ocorrência --}}
{{ __('Open an incident') }}
@error('novaDescricao')

{{ $message }}

@enderror
{{-- lista --}} @forelse ($ocorrencias as $o) @php $cor = $o->type === 'sos' ? '#dc2626' : ($o->severity === 'critica' || $o->severity === 'alta' ? '#b45309' : '#6b7280'); @endphp
@if ($o->type === 'sos') 🚨 @endif {{ $o->tipo_label }} · {{ $o->status_label }} @if ($o->horas_aberta > 0) · {{ $o->horas_aberta }}h {{ __('open') }} @endif
#{{ $o->id }} · {{ $o->created_at->format('d/m/Y H:i') }}

@if ($o->order) {{ __('Ride') }}: {{ $o->order->code }} · @endif @if ($o->driver) {{ __('Driver') }}: {{ $o->driver->name }} · @endif @if ($o->customer) {{ __('Passenger') }}: {{ $o->customer->name }} @endif

@if ($o->handled_by)

{{ __('Responsável') }}: {{ optional(\App\Models\User::find($o->handled_by))->name }} @if ($o->assumed_at) · {{ __('assumiu em') }} {{ $o->assumed_at->format('d/m H:i') }} · {{ __('resposta em') }} {{ \App\Models\SupportTicket::duracao((int) $o->created_at->diffInSeconds($o->assumed_at)) }} @endif

@elseif ($o->type === 'sos')

{{ __('SEM RESPONSÁVEL: assuma para iniciar o protocolo') }}

@endif @if ($o->type === 'sos' && !in_array($o->status, ['resolvida', 'sem_procedencia']))
@foreach (\App\Models\Incident::PROTOCOLO_SOS as $passo => $rotuloPasso) @php $feitoEm = data_get($o->protocolo, $passo); @endphp @endforeach
@endif @if ($o->description)

{{ $o->description }}

@endif @if ($o->resolution)

{{ __('Decision') }} ({{ \App\Models\Incident::ACOES[$o->action_taken] ?? $o->action_taken }}): {{ $o->resolution }}

@endif @if (!in_array($o->status, ['resolvida', 'sem_procedencia']))
@endif
@empty
{{ __('No incidents with these filters.') }}
@endforelse