UI show cost breakdown fields

This commit is contained in:
Ishaan Jaffer 2026-01-30 13:37:01 -08:00
parent f025e8e785
commit 17384e83b7

View file

@ -7,6 +7,7 @@ export interface CostBreakdown {
output_cost?: number;
total_cost?: number;
tool_usage_cost?: number;
additional_costs?: Record<string, number>;
original_cost?: number;
discount_percent?: number;
discount_amount?: number;
@ -88,6 +89,17 @@ export const CostBreakdownViewer: React.FC<CostBreakdownViewerProps> = ({
<span className="text-gray-900">{formatCost(costBreakdown.tool_usage_cost)}</span>
</div>
)}
{/* Additional Costs (free-form) */}
{costBreakdown.additional_costs && Object.keys(costBreakdown.additional_costs).length > 0 && (
<>
{Object.entries(costBreakdown.additional_costs).map(([key, value]) => (
<div key={key} className="flex text-sm">
<span className="text-gray-600 font-medium w-1/3">{key}:</span>
<span className="text-gray-900">{formatCost(value)}</span>
</div>
))}
</>
)}
</div>
{/* Subtotal / Original Cost */}