From 5aabbec42afcabce826fff14a667a2ca3b0b701f Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Fri, 26 Apr 2024 11:59:20 +0100 Subject: fix: Change tag listing API to return unused tags --- apps/web/components/dashboard/tags/AllTagsView.tsx | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'apps/web/components') diff --git a/apps/web/components/dashboard/tags/AllTagsView.tsx b/apps/web/components/dashboard/tags/AllTagsView.tsx index 1f9f2dba..ce780a2f 100644 --- a/apps/web/components/dashboard/tags/AllTagsView.tsx +++ b/apps/web/components/dashboard/tags/AllTagsView.tsx @@ -2,6 +2,11 @@ import Link from "next/link"; import { Button } from "@/components/ui/button"; +import { + Collapsible, + CollapsibleContent, + CollapsibleTrigger, +} from "@/components/ui/collapsible"; import InfoTooltip from "@/components/ui/info-tooltip"; import { Separator } from "@/components/ui/separator"; import { api } from "@/lib/trpc"; @@ -54,7 +59,8 @@ export default function AllTagsView({ const allTags = data.tags.sort((a, b) => b.count - a.count); const humanTags = allTags.filter((t) => (t.countAttachedBy.human ?? 0) > 0); - const aiTags = allTags.filter((t) => (t.countAttachedBy.human ?? 0) == 0); + const aiTags = allTags.filter((t) => (t.countAttachedBy.ai ?? 0) > 0); + const emptyTags = allTags.filter((t) => t.count === 0); const tagsToPill = (tags: typeof allTags) => { let tagPill; @@ -86,6 +92,23 @@ export default function AllTagsView({
{tagsToPill(aiTags)}
+ + + + +

Unused Tags

+ +

Tags that are not attached to any bookmarks

+
+
+ + + + + +
{tagsToPill(emptyTags)}
+
+
); } -- cgit v1.2.3-70-g09d2