<?php use function App\Core\e; $section = 'link-denetimi'; ?>
<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>Link Denetimi</h1><p class="muted">Son link/text/file tarama kayitlari ve risk skorlari.</p></div><button class="pill" data-security-refresh>Yenile</button></div>
        <section class="zpanel-card"><div class="table-scroll"><table class="zpanel-table">
            <thead><tr><th>ID</th><th>Tip</th><th>Hedef</th><th>Risk</th><th>Status</th><th>Aksiyon</th><th>Sebepler</th><th>Tarih</th></tr></thead>
            <tbody data-security-logs>
            <?php foreach (($logs ?? []) as $log): ?><tr><td><?= e($log['id'] ?? '') ?></td><td><?= e($log['scan_type'] ?? '') ?></td><td><?= e($log['target_type'] ?? '-') ?></td><td><?= e((string) ($log['risk_score'] ?? 0)) ?></td><td><span class="status-pill"><?= e($log['status'] ?? $log['result_status'] ?? '-') ?></span></td><td><?= e($log['action_taken'] ?? '-') ?></td><td><?= e(is_array($log['reasons'] ?? null) ? implode(', ', $log['reasons']) : ($log['reasons'] ?? $log['result_reason'] ?? '')) ?></td><td><?= e($log['created_at'] ?? '') ?></td></tr><?php endforeach; ?>
            <?php if (empty($logs)): ?><tr><td colspan="8">Log yok.</td></tr><?php endif; ?>
            </tbody>
        </table></div></section>
    </section>
</div>
