import React from "react";
import { useGame } from "../../hooks/useGame";
import Modal from "../../components/ui/Modal.jsx";

export default function GameModal() {
	const { currentGameModal, setCurrentGameModal } = useGame();
	if (!currentGameModal) return null;

	return (
		<Modal className='game-modal' onClose={() => setCurrentGameModal(null)}>
			<button className='game-modal__close-button' onClick={() => setCurrentGameModal(null)}>
				Close
			</button>

			{currentGameModal}
		</Modal>
	);
}
