From ccff210b4c9834cae4c410f740f804006ed2a8c2 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 14 Feb 2026 09:57:40 +0200 Subject: [PATCH] feat(badges/content): indicate enabled/disabled state --- .../widgets/layout/ActiveContentBadges.tsx | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/apps/client/src/widgets/layout/ActiveContentBadges.tsx b/apps/client/src/widgets/layout/ActiveContentBadges.tsx index 62eb528898..c2eab4a68a 100644 --- a/apps/client/src/widgets/layout/ActiveContentBadges.tsx +++ b/apps/client/src/widgets/layout/ActiveContentBadges.tsx @@ -11,10 +11,10 @@ export function ActiveContentBadges() { const info = useActiveContentInfo(note); console.log("Got inf ", info); - return ( + return (info && <> - {info?.type === "iconPack" && } - + {info.type === "iconPack" && } + ); } @@ -29,11 +29,11 @@ function IconPackBadge() { ); } -function ActiveContentToggle() { - return ; } @@ -41,6 +41,7 @@ const activeContentLabels = [ "iconPack" ] as const; interface ActiveContentInfo { type: "iconPack"; + isEnabled: boolean; } function useActiveContentInfo(note: FNote | null | undefined) { @@ -48,6 +49,7 @@ function useActiveContentInfo(note: FNote | null | undefined) { function refresh() { let type: ActiveContentInfo["type"] | null = null; + let isEnabled = true; if (!note) { setInfo(null); @@ -57,11 +59,16 @@ function useActiveContentInfo(note: FNote | null | undefined) { for (const labelToCheck of activeContentLabels ) { if (note.hasLabel(labelToCheck)) { type = labelToCheck; + break; + } else if (note.hasLabel(`disabled:${labelToCheck}`)) { + type = labelToCheck; + isEnabled = false; + break; } } if (type) { - setInfo({ type }); + setInfo({ type, isEnabled }); } else { setInfo(null); }