From bfc9d8f83696ac875420e40e7b2300bde1c184b3 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 23 Apr 2026 16:58:57 +0000 Subject: [PATCH] feat(ui): UsagePage/EntityUsage/TopKeyView to shadcn - @heroicons ChevronUp/Down \u2192 lucide ChevronUp/ChevronDown + X. - @tremor Button pill \u2192 shadcn-styled native - + + + + + + {info.getValue() as string} + + ), }, { header: "Key Alias", accessorKey: "key_alias", + // eslint-disable-next-line @typescript-eslint/no-explicit-any cell: (info: any) => info.getValue() || "-", }, ]; @@ -108,6 +128,7 @@ const TopKeyView: React.FC = ({ topKeys, teams, showTags = fals const tagsColumn = { header: "Tags", accessorKey: "tags", + // eslint-disable-next-line @typescript-eslint/no-explicit-any cell: (info: any) => { const tags = info.getValue() as TagUsage[] | undefined; const apiKey = info.row.original.api_key; @@ -125,33 +146,43 @@ const TopKeyView: React.FC = ({ topKeys, teams, showTags = fals
{displayTags.map((tag, index) => ( - + + + + + {tag.tag.slice(0, 7)}... + + +
- Tag Name: {tag.tag} +
+ + Tag Name: + {" "} + {tag.tag} +
+
+ Spend:{" "} + {tag.usage > 0 && tag.usage < 0.01 + ? "<$0.01" + : `$${formatNumberWithCommas(tag.usage, 2)}`} +
-
- Spend:{" "} - {tag.usage > 0 && tag.usage < 0.01 ? "<$0.01" : `$${formatNumberWithCommas(tag.usage, 2)}`} -
-
- } - > - {tag.tag.slice(0, 7)}... - + + + ))} {hasMoreTags && ( )} @@ -164,9 +195,12 @@ const TopKeyView: React.FC = ({ topKeys, teams, showTags = fals const spendColumn = { header: "Spend (USD)", accessorKey: "spend", + // eslint-disable-next-line @typescript-eslint/no-explicit-any cell: (info: any) => { const value = info.getValue(); - return value > 0 && value < 0.01 ? "<$0.01" : `$${formatNumberWithCommas(value, 2)}`; + return value > 0 && value < 0.01 + ? "<$0.01" + : `$${formatNumberWithCommas(value, 2)}`; }, }; @@ -192,14 +226,26 @@ const TopKeyView: React.FC = ({ topKeys, teams, showTags = fals />
@@ -246,7 +292,7 @@ const TopKeyView: React.FC = ({ topKeys, teams, showTags = fals />
) : ( -
+
= ({ topKeys, teams, showTags = fals
)} - {isModalOpen && - selectedKey && - keyData && - (console.log("Rendering modal with:", { isModalOpen, selectedKey, keyData }), - ( -
-
- {/* Close button */} - + {isModalOpen && selectedKey && keyData && ( +
+
+ - {/* Content */} -
- -
+
+
- ))} +
+ )} ); };