<?= $this->layout('_theme', ['title' => $title, 'subtitle' => 'Tickets respondidos']); ?>


<div class="flex flex-wrap gap-5 justify-center">
    <?php if ($tickets) :  foreach ($tickets as $ticket) : ?>
            <div class="bg-gray-100 p-2 rounded-lg w-full max-w-xs text-[13px] text-center">
                <p class="bg-neutral-800 text-white p-1 rounded-lg"><?= $ticket->subject ?></p>
                <p class="text-neutral-900 p-1 border-b border-neutral-300"><?= $ticket->account ?> / nome: <?= $ticket->name ?></p>
                <p class="text-neutral-900 p-1 border-b border-neutral-300">Aberto em: <?= date('d/m/y H:i', strtotime($ticket->date)) ?></p>

                <div class="actions flex gap-5 justify-center mt-4">
                    <a class="bg-yellow-500 text-neutral-900 p-1 rounded-sm inline-block hover:bg-yellow-300" href="<?= __redirect("administration/ticket/to/response/{$ticket->id}") ?>" class="button-warning"> Responder </a>
                    <a class="bg-red-500 text-white p-1 rounded-sm inline-block hover:bg-red-300" href="<?= __redirect("administration/ticket/to/finally/{$ticket->id}") ?>" class="button-warning"> Fechar </a>
                    <p class="button-danger bg-red-500 text-white p-1 rounded-sm inline-block hover:bg-red-300"> Remover
                        <a class="hidden bg-red-500 absolute top-0 left-0 z-30 text-white p-1 rounded-sm inline-block hover:bg-red-300" href="<?= __redirect("administration/ticket/to/remove/{$ticket->id}") ?>">Continuar?</a>
                    </p>
                </div>
            </div>
        <?php endforeach;
    else : ?>
        <div class="p-1 bg-yellow-300 text-sm rounded-full text-black text-center w-full">Não há ticket(s) respondido(s) no momento</div>
    <?php endif; ?>

</div>