Add cost metrics to analytics dashboard
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
"use client";
|
||||
|
||||
import { motion } from "motion/react";
|
||||
import { formatNumber, formatTokens } from "@/lib/utils";
|
||||
import { formatNumber, formatTokens, formatUSD } from "@/lib/utils";
|
||||
import { type LucideIcon } from "lucide-react";
|
||||
|
||||
interface StatsCardProps {
|
||||
title: string;
|
||||
value: number;
|
||||
format?: "number" | "tokens";
|
||||
format?: "number" | "tokens" | "usd";
|
||||
icon: LucideIcon;
|
||||
delay?: number;
|
||||
}
|
||||
|
||||
export function StatsCard({ title, value, format = "number", icon: Icon, delay = 0 }: StatsCardProps) {
|
||||
const display = format === "tokens" ? formatTokens(value) : formatNumber(value);
|
||||
const display = format === "tokens" ? formatTokens(value) : format === "usd" ? formatUSD(value) : formatNumber(value);
|
||||
|
||||
return (
|
||||
<motion.div
|
||||
|
||||
Reference in New Issue
Block a user