<div class="container py-5">
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item active" aria-current="page">Lista de Combustíveis</li>
        </ol>
    </nav>

    <?php Sessao::mensagem('combustivel'); ?>

    <a href="<?= URL ?>/combustiveis/cadastrar" class="btn btn-primary mb-3">Cadastrar Novo Combustível</a>

    <div class="table-responsive">
        <table class="table table-bordered table-hover">
            <thead>
                <tr>
                    <th>#</th>
                    <th>Nome</th>
                    <th>Opções</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($dados['combustiveis'] as $combustivel): ?>
                    <tr>
                        <td><?= $combustivel->id_combustivel ?></td>
                        <td><?= htmlspecialchars($combustivel->nome) ?></td>
                        <td>
                            <a href="<?= URL ?>/combustiveis/visualizar/<?= $combustivel->id_combustivel ?>" class="btn btn-info btn-sm">Ver</a>
                            <a href="<?= URL ?>/combustiveis/editar/<?= $combustivel->id_combustivel ?>" class="btn btn-warning btn-sm">Editar</a>
                            <a href="<?= URL ?>/combustiveis/excluir/<?= $combustivel->id_combustivel ?>" class="btn btn-danger btn-sm" onclick="return confirm('Tem certeza?')">Excluir</a>
                        </td>
                    </tr>
                <?php endforeach; ?>
                <?php if (empty($dados['combustiveis'])): ?>
                    <tr>
                        <td colspan="3" class="text-center">Nenhum combustível cadastrado.</td>
                    </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
</div>
