import { useEffect, useState } from "react"; import { v4 } from "uuid"; import { setStateGetChips, setStateReserveCard, setStateReservePlusGold } from "../../hooks/stateSetters"; import { useCurrentPlayer } from "../../hooks/useCurrentPlayer"; import { StateProps } from "../../util/propTypes"; import { ResourceCost } from "../../util/types"; import { getChipsActions } from "../Player/ActionMethods"; import { hasMaxChips } from "../Player/ActionMethods/getChipsActions"; const { getChips } = getChipsActions; export const GetChipsHTML = ({ state, setState }: StateProps) => { const [prompt, setPrompt] = useState(""); const currentPlayer = useCurrentPlayer(state); useEffect(() => { if (!state.actions.getChips.active) setPrompt(""); if (state.actions.getChips.selection?.length === 0) { setPrompt("Please make a selection."); } else { setPrompt(`Your selection is ${state.actions.getChips.valid ? '' : "not"} valid`); } }, [state]) return (
{each}
) }Take a gold chip with your card? {takeGold}
setTakeGold(true)} type="radio" > setTakeGold(false)} type="radio">