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:
parent
1cb60066cd
commit
ecea6b403c
1 changed files with 9 additions and 2 deletions
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue