<?php
$currentPage = basename($_SERVER["SCRIPT_NAME"] ?? "");
function villageAdminNavActive($page, $currentPage) {
    return $page === $currentPage ? "active" : "";
}
?>
<div class="bottom-nav">
    <a class="<?= villageAdminNavActive("dashboard.php", $currentPage) ?>" href="dashboard.php"><span class="nav-icon"><svg viewBox="0 0 24 24"><path d="M3 11l9-8 9 8"/><path d="M5 10v10h14V10"/><path d="M9 20v-6h6v6"/></svg></span><span>Home</span></a>
    <a class="<?= villageAdminNavActive("add-visitor.php", $currentPage) ?>" href="add-visitor.php"><span class="nav-icon"><svg viewBox="0 0 24 24"><path d="M12 5v14"/><path d="M5 12h14"/></svg></span><span>Add</span></a>
    <a class="<?= villageAdminNavActive("visitors.php", $currentPage) ?>" href="visitors.php"><span class="nav-icon"><svg viewBox="0 0 24 24"><path d="M8 6h13"/><path d="M8 12h13"/><path d="M8 18h13"/><path d="M3 6h.01"/><path d="M3 12h.01"/><path d="M3 18h.01"/></svg></span><span>Visitors</span></a>
    <a class="<?= villageAdminNavActive("suspicious-requests.php", $currentPage) ?>" href="suspicious-requests.php"><span class="nav-icon"><svg viewBox="0 0 24 24"><path d="M10.3 3.9L2.6 18a2 2 0 0 0 1.7 3h15.4a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg></span><span>Alerts</span></a>
    <a class="<?= villageAdminNavActive("profile.php", $currentPage) ?>" href="profile.php"><span class="nav-icon"><svg viewBox="0 0 24 24"><path d="M20 21a8 8 0 0 0-16 0"/><circle cx="12" cy="7" r="4"/></svg></span><span>Profile</span></a>
</div>
