import React from 'react'; import type { ApiHandCard } from '../../api/model'; import './Hand.css' type HandCardProps = { card: ApiHandCard, isSelected: boolean, onClick: () => void } const HandCard = ({card, isSelected, onClick}: HandCardProps) => { let playableClass = card.playability.playable ? '' : 'hand-card-unplayable'; let selectedClass = isSelected ? 'hand-card-img-selected' : ''; return
card.playability.playable && onClick()} aria-disabled={!card.playability.playable}> {'Card
}; type HandProps = { cards: ApiHandCard[], selectedCard: ApiHandCard, onClick: (card: ApiHandCard) => void } export const Hand = ({cards, selectedCard, onClick}: HandProps) => { return
{cards.map((c, i) => onClick(c)}/>)}
; }