import { cn } from 'ui' interface QueryCostsProps { currentCost?: number improvedCost?: number improvement?: number className?: string } export const QueryCosts = ({ currentCost, improvedCost, improvement, className, }: QueryCostsProps) => { if (!currentCost) return null return (

Query costs

Total cost of query

Currently:

{typeof currentCost === 'number' && !isNaN(currentCost) && isFinite(currentCost) ? currentCost.toFixed(2) : 'N/A'}

{improvedCost && typeof improvedCost === 'number' && !isNaN(improvedCost) && isFinite(improvedCost) && (

With index:

{improvedCost.toFixed(2)}

{improvement && typeof improvement === 'number' && !isNaN(improvement) && isFinite(improvement) && (

↓ {improvement.toFixed(1)}%

)}
)}
) }