<?= $this->layout('_theme', ['title' => $title, 'subtitle' => 'Gerenciar todos os downloads']); ?>


<div class="flex flex-wrap gap-5 justify-center">
    <?php if ($downloads) : foreach ($downloads as $download) : ?>
            <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"><?= $download['title'] ?></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/to/edit/download/{$download['id']}") ?>" class="button-warning"> Editar </a>
                    <p class="button-danger bg-gray-500 text-white p-1 rounded-sm inline-block cursor-pointer hover:bg-gray-300"> Remover
                        <a class="hidden bg-gray-500 absolute top-0 left-0 text-white p-1 rounded-sm hover:bg-gray-300" href="<?= __redirect("administration/auth/to/remove/download/{$download['id']}") ?>">Continuar ?</a>
                    </p>
                </div>
                <p class="text-neutral-900 p-1 mt-3 border-t border-neutral-300"><?= $download['date'] ?></p>
            </div>
        <?php endforeach;
    else : ?>
        <div class="p-1 bg-yellow-300 text-sm rounded-full text-black text-center w-full">Não há downloads adicionado no momento</div>
    <?php endif; ?>

</div>