mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-31 14:16:39 +01:00
21 lines
773 B
TypeScript
21 lines
773 B
TypeScript
import type { CostByAgent } from "@paperclipai/shared";
|
|
import { Badge } from "./ui/badge";
|
|
|
|
/** Use this group's ledger counts, never the page-wide estimate count. */
|
|
export function CostEstimateLabel({
|
|
eventCount,
|
|
estimatedEventCount,
|
|
}: Partial<Pick<CostByAgent, "eventCount" | "estimatedEventCount">>) {
|
|
if (!estimatedEventCount) return null;
|
|
const allEstimated = estimatedEventCount === eventCount;
|
|
return (
|
|
<Badge
|
|
variant="outline"
|
|
className="font-normal text-muted-foreground"
|
|
title={`${estimatedEventCount} estimated ${estimatedEventCount === 1 ? "charge" : "charges"}. Calculated from token usage and published rates; provider bills may differ.`}
|
|
>
|
|
{allEstimated ? "Estimated" : "Partially estimated"}
|
|
</Badge>
|
|
);
|
|
}
|