import React from 'react'; import type { PriceStats } from '../utils/calculations'; interface StatsPanelProps { stats: PriceStats | null; symbol: string; onClose: () => void; } function fmt(n: number, digits = 2): string { if (!isFinite(n)) return '—'; return n.toLocaleString('en-US', { minimumFractionDigits: digits, maximumFractionDigits: digits }); } function fmtVol(n: number): string { if (n >= 1e9) return (n / 1e9).toFixed(2) + 'B'; if (n >= 1e6) return (n / 1e6).toFixed(2) + 'M'; if (n >= 1e3) return (n / 1e3).toFixed(2) + 'K'; return n.toFixed(0); } const StatRow: React.FC<{ label: string; value: string; highlight?: 'up' | 'down' | 'neutral' }> = ({ label, value, highlight }) => (