<?php
/**
 * HuSNS - 移动端黑名单管理页面
 */
$userId = isset($_SESSION['user_id']) ? $_SESSION['user_id'] : null;
if (!$userId) {
    $this->assign('showLoginModal', true);
}

$currentPage = 'privacy-blacklist';
$pageType = 'privacy';
$bodyClass = 'privacy-page blacklist-page';
$headerTitle = '黑名单管理';

$pageCssFiles = [$this->themeUrl() . '/app/css/privacy.css'];
$pageJsFiles = [$this->themeUrl() . '/app/js/privacy-blacklist.js'];

$this->assign('pageCssFiles', $pageCssFiles);
$this->assign('pageJsFiles', $pageJsFiles);

$this->setLayout('app');
?>

<script>
const BASE_URL = '<?php echo Helper::getBaseUrl(); ?>';
</script>

<div class="privacy-content">
    <!-- 搜索框 -->
    <div class="blacklist-search">
        <input type="text" id="searchBlacklist" placeholder="搜索黑名单用户" class="search-input">
        <span class="search-icon">🔍</span>
    </div>
    
    <!-- 添加黑名单 -->
    <div class="blacklist-add">
        <div class="add-section">
            <div class="add-label">添加用户到黑名单</div>
            <div class="add-input-group">
                <input type="text" id="addBlacklistUsername" placeholder="输入用户名或ID" class="add-input">
                <button class="add-button" id="addBlacklistBtn">添加</button>
            </div>
        </div>
    </div>
    
    <!-- 黑名单列表 -->
    <div class="privacy-section">
        <div class="privacy-section-title">黑名单列表</div>
        
        <div class="blacklist-list" id="blacklistList">
            <!-- 加载状态 -->
            <div class="loading-tip">加载中...</div>
        </div>
        
        <div class="empty-state" id="emptyState" style="display: none;">
            <div class="empty-icon">📭</div>
            <div class="empty-text">黑名单为空</div>
            <div class="empty-desc">添加用户到黑名单后，他们将无法关注你、评论或私信你</div>
        </div>
    </div>
</div>