<?php
/**
 * Active announcement banners.
 *
 * @var \BotGuard\Core\View $this
 * @var array<int,array<string,mixed>> $announcements
 */
foreach (($announcements ?? []) as $a):
    $level = in_array($a['level'], ['info', 'success', 'warning', 'danger'], true) ? $a['level'] : 'info';
    ?>
    <div class="alert alert-<?= e($level) ?> d-flex align-items-start gap-2">
        <i class="bi bi-megaphone-fill mt-1"></i>
        <div>
            <div class="fw-semibold"><?= e($a['title']) ?></div>
            <?php if (! empty($a['body'])): ?><div class="small"><?= e($a['body']) ?></div><?php endif; ?>
        </div>
    </div>
<?php endforeach; ?>
