import { cn } from '@/lib/utils'; import { useState } from 'react'; interface StatsData { totalShares: number; totalInvestment: number; averageCostPerShare: number; currentPrice?: number; currentValue?: number; profitLoss?: number; profitLossPercentage?: number; } interface StatsPanelProps { stats: StatsData; isVisible: boolean; className?: string; } export default function StatsPanel({ stats, isVisible, className }: StatsPanelProps) { const [withdrawalRate, setWithdrawalRate] = useState(0.03); // 3% default const calculateWithdrawal = (rate: number) => { if (!stats.currentValue) return 0; return stats.currentValue * rate; }; const formatCurrency = (amount: number) => { return new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR', minimumFractionDigits: 2, }).format(amount); }; const formatPercentage = (percentage: number) => { return `${percentage >= 0 ? '+' : ''}${percentage.toFixed(2)}%`; }; return (