@if (count($chamados) != 0)
@foreach ($chamados as $chamado)
@php
$openerName = $chamado['opener_name'] ?? data_get($chamado['payload'], 'nome', '');
$openerInitials = collect(explode(' ', trim($openerName)))
->filter()
->take(2)
->map(fn($w) => strtoupper($w[0]))
->implode('');
$openerFoto = $chamado['opener_photo'] ?? null;
$openerCargo = $chamado['opener_cargo'] ?? '';
$openerFilial = $chamado['opener_filial'] ?? '';
$tooltipText = Str::limit(strip_tags(
data_get($chamado['payload'], 'msg', '') ?: ($chamado['content'] ?? '')
), 120);
@endphp
{{-- ID --}}
#{{ $chamado['id'] }}
{{-- Opener --}}
@if ($openerName)
@if ($openerFoto)
 }})
@else
{{ $openerInitials ?: '?' }}
@endif
{{ Str::limit($openerName, 18) }}
@if ($openerCargo || $openerFilial)
{{ Str::limit(implode(' | ', array_filter([Str::limit($openerCargo, 15), $openerFilial])), 32) }}
@endif
@else
Não informado
@endif
{{-- Title --}}
{{-- Status --}}
Solucionado
{{-- Agents --}}
@php $followups = $followupsByTicket[$chamado['id']] ?? []; @endphp
@forelse ($followups as $fi => $user)
@php
$name = $user->name ?? ($admin[$user->user_id] ?? 'Usuário');
$initials = collect(explode(' ', trim($name)))
->filter()
->take(2)
->map(fn($w) => strtoupper($w[0]))
->implode('');
@endphp
@if ($user->photo)
 }})
@else
{{ $initials }}
@endif
@empty
—
@endforelse
{{-- Dates --}}
Aberto
{{ date('d/m/y', strtotime($chamado['date_creation'])) }}
Soluc.
{{ date('d/m/y', strtotime($chamado['date_mod'])) }}
{{-- Actions --}}
@endforeach
{{-- Modal Chamados --}}
{{ $chamados->appends(request()->except('page'))->links() }}
@else
@include('admin.view._empty')
@endif