<?php use function App\Core\e; $section = 'domain-listeleri'; ?>
<div class="panel zpanel zpanel-app" data-security-bot data-api-base="<?= e(App\Core\url('/api')) ?>" data-csrf="<?= e($csrfToken ?? '') ?>">
    <?php require BASE_PATH . '/app/Views/zpanel/_sidebar.php'; ?>
    <section class="panel-body zpanel-main">
        <div class="zpanel-head"><div><p class="eyebrow">Zalorox Shield</p><h1>Domain Whitelist / Blacklist</h1><p class="muted">Guvenli ve riskli domain listeleri.</p></div></div>
        <div class="zpanel-grid two">
            <?php foreach ([['Whitelist','domain-whitelist',$whitelist ?? []],['Blacklist','domain-blacklist',$blacklist ?? []]] as $block): ?>
                <section class="zpanel-card">
                    <div class="zpanel-card-head"><h2><?= e($block[0]) ?></h2></div>
                    <form class="zpanel-form" data-security-create="/zpanel/<?= e($block[1]) ?>/create">
                        <input type="hidden" name="_csrf" value="<?= e($csrfToken ?? '') ?>">
                        <label>Domain<input name="domain" placeholder="drive.google.com" required></label>
                        <label>Aciklama<input name="description"></label>
                        <button class="pill primary">Ekle</button>
                    </form>
                    <div class="security-list">
                        <?php foreach ($block[2] as $domain): ?><div class="security-list-row"><span><strong><?= e($domain['domain'] ?? '') ?></strong><small><?= e($domain['description'] ?? '') ?></small></span><button data-security-delete="/zpanel/<?= e($block[1]) ?>/delete" data-id="<?= e($domain['id'] ?? '') ?>">Sil</button></div><?php endforeach; ?>
                        <?php if (empty($block[2])): ?><p class="muted">Kayit yok.</p><?php endif; ?>
                    </div>
                </section>
            <?php endforeach; ?>
        </div>
    </section>
</div>
