<h2 class="mb-4"><i class="bi bi-plug"></i> Plugins</h2>

<?php if (empty($plugins)): ?>
    <div class="alert alert-info">Geen plugins gevonden in de plugins map.</div>
<?php else: ?>
    <div class="row g-4">
        <?php foreach ($plugins as $plugin): ?>
            <div class="col-md-6">
                <div class="card shadow-sm">
                    <div class="card-header d-flex justify-content-between align-items-center">
                        <strong><i class="bi bi-plug"></i> <?= htmlspecialchars($plugin['name']) ?></strong>
                        <?php if ($plugin['enabled']): ?>
                            <span class="badge bg-success">Actief</span>
                        <?php else: ?>
                            <span class="badge bg-secondary">Inactief</span>
                        <?php endif; ?>
                    </div>
                    <div class="card-body">
                        <table class="table table-sm mb-0">
                            <tr>
                                <td class="text-muted">Hoofdbestand</td>
                                <td>
                                    <?= $plugin['has_main'] ? '<i class="bi bi-check-circle text-success"></i> Aanwezig' : '<i class="bi bi-x-circle text-danger"></i> Ontbreekt' ?>
                                </td>
                            </tr>
                            <tr>
                                <td class="text-muted">Configuratie</td>
                                <td>
                                    <?= $plugin['has_config'] ? '<i class="bi bi-check-circle text-success"></i> Aanwezig' : '<i class="bi bi-dash-circle text-muted"></i> Geen' ?>
                                </td>
                            </tr>
                            <tr>
                                <td class="text-muted">README</td>
                                <td>
                                    <?= $plugin['has_readme'] ? '<i class="bi bi-check-circle text-success"></i> Aanwezig' : '<i class="bi bi-dash-circle text-muted"></i> Geen' ?>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        <?php endforeach; ?>
    </div>
<?php endif; ?>
