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 (
Total cost of query
Currently:
{typeof currentCost === 'number' && !isNaN(currentCost) && isFinite(currentCost) ? currentCost.toFixed(2) : 'N/A'}
With index:
{improvedCost.toFixed(2)}
{improvement && typeof improvement === 'number' && !isNaN(improvement) && isFinite(improvement) && (↓ {improvement.toFixed(1)}%
)}