From c86c6bc507e13e468d4f9173ec9a41aa9f9b1bd6 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Tue, 14 Oct 2025 11:11:37 -0700 Subject: [PATCH] v0 for Export --- .../src/components/entity_usage.tsx | 68 +++++++++++++------ 1 file changed, 49 insertions(+), 19 deletions(-) diff --git a/ui/litellm-dashboard/src/components/entity_usage.tsx b/ui/litellm-dashboard/src/components/entity_usage.tsx index 7e6ff740c5d..3d2298040a2 100644 --- a/ui/litellm-dashboard/src/components/entity_usage.tsx +++ b/ui/litellm-dashboard/src/components/entity_usage.tsx @@ -20,6 +20,7 @@ import { Tab, TabPanels, Subtitle, + Button, } from "@tremor/react"; import AdvancedDatePicker from "./shared/advanced_date_picker"; import { Select } from "antd"; @@ -30,6 +31,7 @@ import TopKeyView from "./top_key_view"; import { formatNumberWithCommas } from "@/utils/dataUtils"; import { valueFormatterSpend } from "./usage/utils/value_formatters"; import { getProviderLogoAndName } from "./provider_info_helpers"; +import EntityUsageExportModal from "./entity_usage_export_modal"; interface EntityMetrics { metrics: { @@ -103,6 +105,7 @@ const EntityUsage: React.FC = ({ from: new Date(Date.now() - 28 * 24 * 60 * 60 * 1000), to: new Date(), }); + const [isExportModalOpen, setIsExportModalOpen] = useState(false); const fetchSpendData = async () => { if (!accessToken || !dateValue.from || !dateValue.to) return; @@ -328,27 +331,45 @@ const EntityUsage: React.FC = ({ }; return ( -
- - - - - {entityList && entityList.length > 0 && ( +
+
+ - Filter by {entityType === "tag" ? "Tags" : "Teams"} - + + )} + + +
Cost @@ -653,6 +674,15 @@ const EntityUsage: React.FC = ({ + + setIsExportModalOpen(false)} + entityType={entityType} + spendData={spendData} + dateRange={dateValue} + selectedFilters={selectedTags} + />
); };