<?php $__env->startSection("title", env("APP_NAME") . " :: Meu Chamados"); ?>
<?php $__env->startSection('content'); ?>

<div class="card shadow-sm border-0">

    <?php $headLine = "<i class='fa-solid fa-headset'></i> Meu Chamados"; ?>

    <?php echo $__env->make('components.buttons._headLineButtonsBackAdd', [
        'headLine' => __($headLine),
        'routeBack' => 'admin.contaAngra.index',
        'routeBackParams' => [], 
        'nameBack' => __("Voltar"),
        'routeAdd' => 'admin.contaAngra.chamados.create',
        'routeAddParams' => [], 
        'nameAdd' => __('Novo atendimento'),
        "permission" => "GERENCIADOR_DE_CONTA_ANGRA",
    ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

    <div class="card-body">

            <?php echo $__env->make("errors.messageFlash", array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
            <?php echo $__env->make('components.modal._modelProfile', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

            <?php echo $__env->make('components/forms/_filtroPesquisaDefault', [ 
                "id" => "cadastroDeUsuario", 
                "placeholder" => "Pesquisar atendimento..."
            ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

            <?php if (isset($component)) { $__componentOriginal0650541a119648223455610148c86d0b = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal0650541a119648223455610148c86d0b = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.tables._table','data' => ['thead' => ['Protocolo','Criado em','Enviado para','Assunto', 'Andamento', 'Ações'],'pagination' => $chamados->links()]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('tables._table'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['thead' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(['Protocolo','Criado em','Enviado para','Assunto', 'Andamento', 'Ações']),'pagination' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($chamados->links())]); ?>
                 <?php $__env->slot('body', null, []); ?> 
                    <?php
                        $index = 0;
                        $mensagensNaoLidasPorChamado = $mensagensNaoLidasPorChamado ?? [];
                    ?>
                     <?php $__currentLoopData = $chamados; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $chamado): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td class="chamado-registro-numero-cell">
                                <?php if (isset($component)) { $__componentOriginal018c289c834ca61b8c2b8ef0361ed1dd = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal018c289c834ca61b8c2b8ef0361ed1dd = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.chamados.registro-numero-badge','data' => ['numero' => $chamado->numeroChamado,'naoLidas' => $mensagensNaoLidasPorChamado[(string) $chamado->id] ?? 0,'monospace' => false]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('chamados.registro-numero-badge'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['numero' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($chamado->numeroChamado),'nao-lidas' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($mensagensNaoLidasPorChamado[(string) $chamado->id] ?? 0),'monospace' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(false)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal018c289c834ca61b8c2b8ef0361ed1dd)): ?>
<?php $attributes = $__attributesOriginal018c289c834ca61b8c2b8ef0361ed1dd; ?>
<?php unset($__attributesOriginal018c289c834ca61b8c2b8ef0361ed1dd); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal018c289c834ca61b8c2b8ef0361ed1dd)): ?>
<?php $component = $__componentOriginal018c289c834ca61b8c2b8ef0361ed1dd; ?>
<?php unset($__componentOriginal018c289c834ca61b8c2b8ef0361ed1dd); ?>
<?php endif; ?>
                            </td>
                            <td><?php echo e(date("d/m/Y H:i", strtotime($chamado->created_at))); ?></td>
                            <td><?php echo e($chamado->convenioAtual); ?></td>
                            <td><?php echo e($chamado->assunto); ?></td>
                            <td><?php echo e($chamado->statusChamado); ?></td>
                            <td>
                                <div class="d-flex gap-2 justify-content-center">
                                    
                                    <?php if($chamado->statusChamado == "Em edição"): ?>
                                    
                                        <?php echo $__env->make('components.buttons._editButton', [
                                            "route" => "admin.contaAngra.chamados.edit",
                                            "id" => $chamado->id,
                                            "title" => "Editar",
                                            "fontawesome" => null,
                                            "permission" => "GERENCIADOR_DE_CONTA_ANGRA",
                                        ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                                    
                                        <?php echo $__env->make('components.buttons._deleteButton', [
                                            "message" => __("* Este atendimento e seu histórico serão excluídos e esta ação não poderá ser desfeita, deseja continuar?"),
                                            "route" => "admin.contaAngra.chamados.destroy",
                                            "id" => $chamado->id,
                                            "title" => "Excluir",
                                            "fontawesome" => null,
                                            "permission" => "GERENCIADOR_DE_CONTA_ANGRA",
                                        ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                                    <?php else: ?>
                                        <?php echo $__env->make('components.buttons._editButton', [
                                            "route" => "admin.contaAngra.chamados.show",
                                            "id" => $chamado->id,
                                            "title" => "Página de Acompanhamento",
                                            "fontawesome" => "<i class='fa-solid fa-eye'></i>",
                                            "permission" => "GERENCIADOR_DE_CONTA_ANGRA",
                                        ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                                    <?php endif; ?>
                                </div>
                            </td>
                        </tr>
                        <?php $index++; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                 <?php $__env->endSlot(); ?>
             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal0650541a119648223455610148c86d0b)): ?>
<?php $attributes = $__attributesOriginal0650541a119648223455610148c86d0b; ?>
<?php unset($__attributesOriginal0650541a119648223455610148c86d0b); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal0650541a119648223455610148c86d0b)): ?>
<?php $component = $__componentOriginal0650541a119648223455610148c86d0b; ?>
<?php unset($__componentOriginal0650541a119648223455610148c86d0b); ?>
<?php endif; ?>

        </div>

</div>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin.theme', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/portal/resources/views/admin/contaAngra/chamados/index.blade.php ENDPATH**/ ?>