"use client"; import { LoaderIcon } from "lucide-react"; import { useTranslations } from "next-intl"; import { compactNumberFormatter, formatCost } from "./shared"; export type TopEntity = { key: string; label: string; sublabel?: string | null; requests: number; totalTokens: number; costUsd: number | null; }; type TopEntitiesListProps = { entities: TopEntity[]; isLoading: boolean; nameColumnLabel: string; emptyLabel?: string; }; export function TopEntitiesList(props: TopEntitiesListProps) { const t = useTranslations(); const totalCost = props.entities.reduce( (sum, e) => sum + (e.costUsd ?? 0), 0 ); return (