UNPKG

slanted-gamedev-toolz

Version:

A slanted mix of tools for your brilliant ideas in game design.

17 lines (16 loc) 1.58 kB
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime"; import { dealBtnDisabledStyle, dealBtnStyle } from "./style/catDeskSx"; import { selectedGreenGlow } from "../GameCard/GameCardSx"; export const ShuffleDealBtn = ({ isHandDealt, shuffleDeck, remainingDeck, showNextLevelBtn, isAllowDealing, nextLevel, isLevelBeaten, isGameOver, nextHand, handsRemaining, restartGame, isOutOfHands, levelScore, }) => { const dealTxt = levelScore === 0 ? "Deal" : "Next Turn"; return (_jsx(_Fragment, { children: isHandDealt ? (_jsx("button", { style: dealBtnStyle, onClick: shuffleDeck, children: `Shuffle Deck (${remainingDeck.length})` })) : (_jsx("div", { children: showNextLevelBtn && !isGameOver ? (_jsx("button", { style: { ...(isAllowDealing ? dealBtnStyle : dealBtnDisabledStyle), boxShadow: selectedGreenGlow, }, onClick: nextLevel, children: "Next Level" })) : (_jsx(_Fragment, { children: isLevelBeaten ? (_jsx("button", { style: { ...(isAllowDealing ? dealBtnStyle : dealBtnDisabledStyle), boxShadow: selectedGreenGlow, }, onClick: nextHand, children: `${dealTxt} (${handsRemaining} remaining)` })) : (_jsx("button", { style: { ...(isAllowDealing ? dealBtnStyle : dealBtnDisabledStyle), boxShadow: selectedGreenGlow, }, onClick: isGameOver ? restartGame : nextHand, children: `${isOutOfHands ? "Restart" : dealTxt} (${handsRemaining} remaining)` })) })) })) })); };