import React, {FunctionComponent} from 'react';
import Card from "./Card";

interface Props {
    hand: string[];
    actionOnClick?: (cardString: string) => void;
    isHidden?: boolean;
}

const Hand: FunctionComponent<Props> = ({hand, actionOnClick, isHidden}) => {

    return (
        <ul className="hand">
            {
                hand.map((card, index) => {
                    return (
                        <li key={card} className={"hand__item"}>
                            <Card cardString={card} handleClick={actionOnClick} isHidden={isHidden}/>
                        </li>
                    )
                })
            }
        </ul>
    )
}

export default Hand;
