diff --git a/src/components/Configs/ConfigList/Cells/ConfigListTagsCell.tsx b/src/components/Configs/ConfigList/Cells/ConfigListTagsCell.tsx index 010a20da6..bae870a50 100644 --- a/src/components/Configs/ConfigList/Cells/ConfigListTagsCell.tsx +++ b/src/components/Configs/ConfigList/Cells/ConfigListTagsCell.tsx @@ -6,17 +6,19 @@ import { ConfigItem } from "../../../../api/types/configs"; type ConfigListTagsCellProps< T extends { - tags: Record; + tags?: Record; + id: string; } -> = Pick, any>, "getValue"> & { +> = Pick, any>, "getValue" | "row"> & { hideGroupByView?: boolean; label?: string; enableFilterByTag?: boolean; }; export default function ConfigListTagsCell< - T extends { tags: Record } + T extends { tags?: Record; id: string } >({ + row, getValue, hideGroupByView = false, enableFilterByTag = false @@ -100,6 +102,7 @@ export default function ConfigListTagsCell< key, value }} + id={row.original.id} key={value} variant="gray" onFilterByTag={enableFilterByTag ? onFilterByTag : undefined} diff --git a/src/ui/Tags/Tag.tsx b/src/ui/Tags/Tag.tsx index b58b5e0fb..c9ef16569 100644 --- a/src/ui/Tags/Tag.tsx +++ b/src/ui/Tags/Tag.tsx @@ -27,40 +27,51 @@ export function Tag({ className = "flex flex-row px-1 py-0.5 rounded-md text-xs whitespace-nowrap break-inside-avoid-column", variant = "gray", tag, + id, onFilterByTag, ...props }: TagProps) { return ( <>
{children} - {onFilterByTag && tag && ( -
- onFilterByTag(e, tag, "include")} - icon={} - title="Include" - /> - onFilterByTag(e, tag, "exclude")} - icon={} - title="Exclude" - /> -
- )}
- {tag && } + {tag && ( + +
+

+ {tag.key}: {tag.value} +

+ {onFilterByTag && tag && ( +
+ onFilterByTag(e, tag, "include")} + icon={} + title="Include" + /> + onFilterByTag(e, tag, "exclude")} + icon={} + title="Exclude" + /> +
+ )} +
+
+ )} ); }