import { styled } from '@mui/material/styles'; import Dialog from '@mui/material/Dialog'; import DialogContent from '@mui/material/DialogContent'; import DialogTitle from '@mui/material/DialogTitle'; import Typography from '@mui/material/Typography'; import Button from '@mui/material/Button'; import { useDeckSelectDialog } from './useDeckSelectDialog'; import './DeckSelectDialog.css'; const PREFIX = 'DeckSelectDialog'; const classes = { root: `${PREFIX}-root`, }; const StyledDialog = styled(Dialog)(({ theme }) => ({ [`&.${classes.root}`]: { '& .dialog-title__wrapper': { borderColor: theme.palette.grey[300], }, }, })); export interface DeckSelectDialogProps { isOpen: boolean; gameId: number | undefined; /** * Unlike ZoneViewDialog (which takes a required `handleClose`), the * deck-select dialog is auto-gated by the game's pre-ready lobby state: * it opens when `!game.started && !spectator && !judge && !readyStart` * and closes when any of those flip. Tests pass a no-op; production * callers typically omit this prop, letting MUI render a non-dismissable * modal (no backdrop-click or ESC close). */ handleClose?: () => void; } function DeckSelectDialog({ isOpen, gameId, handleClose }: DeckSelectDialogProps) { const { deckText, setDeckText, deckHash, isReady, canSubmit, canToggleReady, handleSubmitDeck, handleToggleReady, } = useDeckSelectDialog(gameId); return (
Select Deck
Paste your deck list below, then click Submit Deck. After the server accepts the deck, the Ready button unlocks.