<?php
/**
 * 快捷入口组件
 * 
 * @param array $items 入口项数组
 */

$items = $items ?? [];
$baseUrl = Helper::getBaseUrl();

$defaultItems = [
    [
        'icon' => 'mdi:fire',
        'text' => '热门',
        'url' => $baseUrl . '/?r=mobile/hot',
        'color' => '#FF6B6B'
    ],
    [
        'icon' => 'mdi:account-group',
        'text' => '圈子',
        'url' => $baseUrl . '/?r=mobile/circles',
        'color' => '#4ECDC4'
    ],
    [
        'icon' => 'mdi:tag-multiple',
        'text' => '话题',
        'url' => $baseUrl . '/?r=mobile/topics',
        'color' => '#45B7D1'
    ],
    [
        'icon' => 'mdi:star',
        'text' => '推荐',
        'url' => $baseUrl . '/?r=mobile/recommend',
        'color' => '#96CEB4'
    ]
];

$items = !empty($items) ? $items : $defaultItems;
?>
<div class="quick-entry-grid">
    <?php foreach ($items as $item): ?>
    <a href="<?php echo $item['url']; ?>" class="quick-entry-item">
        <div class="quick-entry-icon" style="background-color: <?php echo $item['color'] ?? '#007AFF'; ?>;">
            <span class="iconify" data-icon="<?php echo $item['icon']; ?>"></span>
        </div>
        <span class="quick-entry-text"><?php echo $item['text']; ?></span>
    </a>
    <?php endforeach; ?>
</div>
