import { PrestigeUpgrade } from '../types'; import { formatNumber } from '../utils/formatters'; import '../styles/PrestigePanel.css'; interface PrestigePanelProps { totalCurrency: number; prestigePoints: number; prestigeUpgrades: PrestigeUpgrade[]; onPrestige: () => void; onPurchaseUpgrade: (upgradeId: string) => void; } const PrestigePanel = ({ totalCurrency, prestigePoints, prestigeUpgrades, onPrestige, onPurchaseUpgrade }: PrestigePanelProps) => { // Calculate how many prestige points would be earned const potentialPrestigePoints = Math.floor(Math.sqrt(totalCurrency / 1000000)); return (

Prestige

Total Currency Earned: {formatNumber(totalCurrency)}

Current Prestige Points: {formatNumber(prestigePoints)}

Prestige Now For: {formatNumber(potentialPrestigePoints)} points

Prestige Upgrades

{prestigeUpgrades.map(upgrade => { const canAfford = prestigePoints >= upgrade.cost; return (
canAfford && !upgrade.purchased && onPurchaseUpgrade(upgrade.id)} >
{upgrade.icon}

{upgrade.name}

{upgrade.description}

Multiplier: +{upgrade.multiplierBonus.toFixed(2)}x

{upgrade.purchased ? (

PURCHASED

) : (

Cost: {formatNumber(upgrade.cost)} PP

)}
); })}
); }; export default PrestigePanel;