<?= $this->extend('layouts/app') ?>

<?= $this->section('content') ?>
<div class="core-card p-4">
    <div class="d-flex justify-content-between align-items-center mb-3">
        <div>
            <h2 class="h5 mb-0"><?= esc($connection['name'] ?? 'Connexion') ?></h2>
            <div class="text-muted small"><?= esc($connection['database_name'] ?? '') ?></div>
        </div>
        <a class="btn btn-outline-secondary btn-sm" href="<?= site_url('/database-connections') ?>">Retour</a>
    </div>

    <?php if ($error): ?>
        <div class="alert alert-danger"><?= esc($error) ?></div>
    <?php endif; ?>

    <div class="row g-2">
        <?php foreach ($tables as $table): ?>
            <div class="col-md-3"><div class="border rounded p-2 bg-light"><code><?= esc($table) ?></code></div></div>
        <?php endforeach; ?>
    </div>
</div>
<?= $this->endSection() ?>
