<?php
/**
 * HuSNS Mobile TabBar 组件
 * 所有页面共用的底部导航栏
 */

$baseUrl = Helper::getBaseUrl();
$currentPage = $currentPage ?? 'home';
$userId = isset($_SESSION['user_id']) ? $_SESSION['user_id'] : null;
?>
<nav class="app-footer">
    <a href="<?php echo $baseUrl; ?>/?r=mobile/index" class="app-tabbar-item <?php echo $currentPage === 'home' ? 'active' : ''; ?>">
        <span class="iconify app-tabbar-icon" data-icon="mdi:home"></span>
        <span class="app-tabbar-text">首页</span>
    </a>
    <a href="<?php echo $baseUrl; ?>/?r=mobile/discover" class="app-tabbar-item <?php echo $currentPage === 'discover' ? 'active' : ''; ?>">
        <span class="iconify app-tabbar-icon" data-icon="mdi:compass"></span>
        <span class="app-tabbar-text">发现</span>
    </a>
    <a href="javascript:void(0);" class="app-tabbar-item app-tabbar-publish" onclick="handlePublishClick()">
        <span class="iconify app-tabbar-icon-publish"></span>
    </a>
    <a href="javascript:void(0);" class="app-tabbar-item <?php echo $currentPage === 'notification' ? 'active' : ''; ?>" onclick="handleNotificationClick()">
        <span class="iconify app-tabbar-icon" data-icon="mdi:bell"></span>
        <span class="unread-badge" style="display: none;">0</span>
        <span class="app-tabbar-text">消息</span>
    </a>
    <a href="javascript:void(0);" class="app-tabbar-item <?php echo $currentPage === 'profile' ? 'active' : ''; ?>" onclick="handleProfileClick()">
        <span class="iconify app-tabbar-icon" data-icon="mdi:account"></span>
        <span class="app-tabbar-text">我的</span>
    </a>
</nav>
