<nav class="flex flex-wrap gap-2">
    <?php foreach ($tabs as $tab) : ?>
        <a href="<?= esc($tab['href']) ?>" class="tab-link <?= ! empty($tab['active']) ? 'tab-link-active' : '' ?>">
            <span><?= esc($tab['label']) ?></span>
            <?php if ($tab['count'] !== null) : ?>
                <span class="ml-2 rounded-full bg-white/20 px-2 py-0.5 text-xs font-semibold"><?= esc((string) $tab['count']) ?></span>
            <?php endif; ?>
        </a>
    <?php endforeach; ?>
</nav>
