<?= $this->layout('_theme', ['title' => $title, 'subtitle' => 'Todos os itens']); ?>

<div class="admin-form admin-datatable p-4 bg-gray-100 rounded-lg">
    <?php if ($items) : ?>
        <table id="tableitem" class="display" style="width:100%">
            <thead>
                <tr>
                    <th>Nome</th>
                    <th>Categoria</th>
                    <th>Grupo</th>
                    <th>Moeda (coluna)</th>
                    <th></th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($items as $item) : ?>
                    <tr>
                        <td class="text-xs text-white" ><?= $item['name'] ?></td>
                        <td align="center"><?= $item['category'] ?></td>
                        <td class="text-xs" align="center"><?= $item['group'] ?></td>
                        <td class="text-xs" align="center"><?= $item['column'] ?></td>
                        <td>
                            <a class="bg-sky-500 text-white p-1 text-xs rounded-sm hover:bg-sky-700" href="<?= __redirect("administration/shopping/to/edit/item/{$item['id']}") ?>">Editar</a>
                        </td>
                        <td>
                            <a class="bg-red-500 text-white p-1 text-xs rounded-sm hover:bg-red-700" href="<?= __redirect("administration/shopping/to/remove/item/{$item['id']}") ?>">Remover</a>
                        </td>
                    </tr>
                <?php endforeach; ?>
            </tbody>

        </table>
    <?php else : ?>
        <div class="message_warning">Não há itens adicionado no momento</div>
    <?php endif ?>
</div>