fix(ui): update tag spend formatting and mock

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
mrinal 2026-10-21 16:27:33 +00:00 • committed by Mrinal Chanshetty
parent 1d7b02d217
commit 9b986fb517
2 changed files with 6 additions and 12 deletions

View file

@ -4,10 +4,7 @@ import React, { useEffect, useMemo, useState } from "react";
import { DataTable, DataTablePagination } from "@/components/shared/DataTable";
import { MoneyCell } from "@/components/shared/table_cells";
import type {
DailyActivityTagPageResponse,
DailyActivityTagSpendRow,
} from "@/components/UsagePage/dailyActivityApi";
import type { DailyActivityTagPageResponse, DailyActivityTagSpendRow } from "@/components/UsagePage/dailyActivityApi";
import { Panel } from "../overview/Primitives";
@ -78,12 +75,7 @@ const columns: ColumnDef<DailyActivityTagSpendRow>[] = [
},
];
const useTeamTagSpendPage = ({
accessToken,
startTime,
endTime,
teamId,
}: TeamTagSpendCardProps): TeamTagSpendPage => {
const useTeamTagSpendPage = ({ accessToken, startTime, endTime, teamId }: TeamTagSpendCardProps): TeamTagSpendPage => {
const startTimestamp = startTime?.getTime();
const endTimestamp = endTime?.getTime();
const requestScope = useMemo(
@ -110,7 +102,8 @@ const useTeamTagSpendPage = ({
limit: PAGE_SIZE,
signal: controller.signal,
};
void ENTITY_API.team.tagPage(tagPageRequest)
void ENTITY_API.team
.tagPage(tagPageRequest)
.then((response) => {
if (controller.signal.aborted) return;
const nextPageState: TagPageState = { scope: requestScope, page, response, failed: false };
@ -131,7 +124,7 @@ const useTeamTagSpendPage = ({
const loading = enabled && currentPageState === null;
const failed = currentPageState?.failed ?? false;
const rows = failed ? [] : (currentPageState?.response?.tags ?? []);
const rows = failed ? [] : currentPageState?.response?.tags ?? [];
const totalTags = currentScopeState?.response?.total_tags ?? 0;
const onPageChange = (nextPage: number) => setPageState({ scope: requestScope, page: nextPage });

View file

@ -81,6 +81,7 @@ vi.mock("@/components/networking", () => ({
subscriptionAccountDeleteCall: vi.fn(),
dailyActivityAggregatedCall: vi.fn(),
dailyActivityKeyPageCall: vi.fn(),
dailyActivityTagPageCall: vi.fn(),
userDailyActivityUserPageCall: vi.fn(),
dailyActivityKeySearchCall: vi.fn(),
dailyActivityModelTopKeysCall: vi.fn(),