UNPKG

slanted-gamedev-toolz

Version:

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

6 lines (5 loc) 1.13 kB
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime"; import { dealBtnDisabledStyle, dealBtnStyle } from "./catDeskSx"; export const ShuffleDealBtn = ({ isHandDealt, shuffleDeck, remainingDeck, showNextLevelBtn, isAllowDealing, nextLevel, isLevelBeaten, isGameOver, dealCards, handsRemaining, restartGame, isOutOfHands, }) => { return (_jsx(_Fragment, { children: isHandDealt ? (_jsx("button", { style: dealBtnStyle, onClick: shuffleDeck, children: `Shuffle (${remainingDeck.length})` })) : (_jsx("div", { children: showNextLevelBtn && !isGameOver ? (_jsx("button", { style: isAllowDealing ? dealBtnStyle : dealBtnDisabledStyle, onClick: nextLevel, children: "Next Level" })) : (_jsx(_Fragment, { children: isLevelBeaten ? (_jsx("button", { style: isAllowDealing ? dealBtnStyle : dealBtnDisabledStyle, onClick: dealCards, children: `Deal (${handsRemaining} remaining)` })) : (_jsx("button", { style: isAllowDealing ? dealBtnStyle : dealBtnDisabledStyle, onClick: isGameOver ? restartGame : dealCards, children: `${isOutOfHands ? "Restart" : "Deal"} (${handsRemaining} hands remaining)` })) })) })) })); };