feat: harden analytics dashboard
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
Cell,
|
||||
} from "recharts";
|
||||
import { formatTokens } from "@/lib/utils";
|
||||
import { useI18n } from "@/lib/i18n";
|
||||
|
||||
interface RankItem {
|
||||
name: string;
|
||||
@@ -31,6 +32,7 @@ export function RankingBar({
|
||||
data: RankItem[];
|
||||
title: string;
|
||||
}) {
|
||||
const { t } = useI18n();
|
||||
if (!data.length) return null;
|
||||
const sliced = data.slice(0, 10);
|
||||
|
||||
@@ -54,7 +56,7 @@ export function RankingBar({
|
||||
color: "#c8d6e5",
|
||||
fontSize: "12px",
|
||||
}}
|
||||
formatter={(v) => [formatTokens(Number(v)), "Total Tokens"]}
|
||||
formatter={(v) => [formatTokens(Number(v)), t("th.totalToken")]}
|
||||
/>
|
||||
<Bar dataKey="total_tokens" radius={[0, 4, 4, 0]}>
|
||||
{sliced.map((_, i) => (
|
||||
|
||||
Reference in New Issue
Block a user