import React from 'react'; import type { Tier } from '../App'; import type { Upgrades } from './GubbleStore'; import ScratchFieldButton from './ScratchFieldButton'; type CardProps = { card: { winningNumbers: number[]; fields: { value: number; scratched: boolean; won: number | null }[]; tier: Tier | null; }; setCard: React.Dispatch>; setMoney: React.Dispatch>; setGubblePoints: React.Dispatch>; upgrades?: Upgrades; }; const Card: React.FC = ({ card, setCard, setMoney, setGubblePoints, upgrades }) => { const formatter = Intl.NumberFormat( 'en', { 'notation': 'compact' } ) return (
{card.tier?.name} Scratch Card
{card.winningNumbers.map((num, i) => (
{num}
))}
{card.fields.map((field, idx) => ( ))}
Scratch each field one at a time. Winnings: 1-2 = 50%, 3-4 = 80%, 5-6 = 120% of card price.
); }; export type { CardProps }; export default React.memo(Card);