Untitled

mail@pastecode.io avatar
unknown
javascript
2 years ago
649 B
2
Indexable
Never
import {useEffect, useState} from 'react'

export default function Card({card, handleAceSet, setTotal, total, as, setAs}){
    const [click, setClick] = useState(false)

    return (
        <div>
       <div className="card"
       style={{color: card.color}} 
       >{card.unicode}</div>

       {card.card === "A" && (
        <div>
        <button onClick={() => (setAs(as + 1), setClick(true))}  disabled={click ? true : false}>
          add 1
        </button>
        <button onClick={() => (setAs(as + 11), setClick(true))} disabled={click ? true : false}>Add 11</button>
        </div>
    )}
        </div>
    )
}