feat(filters): show channel counts on topic and language chips

The per-tag channel_count was already returned by GET /api/tags but only
surfaced in the chip tooltip. Render it as a small count badge on the chip
face so the relative weight of each topic/language is visible at a glance.
This commit is contained in:
npeter83 2026-06-15 03:08:03 +02:00
parent 6c8b9d6986
commit b325893b22

View file

@ -81,13 +81,20 @@ function TagChip({
<button
onClick={onClick}
title={t("sidebar.channelCount", { count: tag.channel_count })}
className={`text-xs px-2.5 py-1 rounded-full border shadow-sm hover:shadow active:translate-y-px transition ${
className={`inline-flex items-center gap-1.5 text-xs px-2.5 py-1 rounded-full border shadow-sm hover:shadow active:translate-y-px transition ${
active
? "bg-accent text-accent-fg border-accent"
: "bg-card border-border text-fg hover:border-accent"
}`}
>
{tag.name}
<span>{tag.name}</span>
<span
className={`tabular-nums text-[10px] leading-none px-1 py-0.5 rounded-full ${
active ? "bg-accent-fg/20 text-accent-fg" : "bg-muted/15 text-muted"
}`}
>
{tag.channel_count}
</span>
</button>
);
}