Private
Public Access
1
0
Files
MineSeeker/assets/js/mine-seeker/components/GameBoard.jsx

35 lines
898 B
React
Raw Normal View History

/**
* This file is part of the SplendidBear Websites' projects.
*
* Copyright (c) 2026 @ www.splendidbear.org
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import React from 'react';
import { useGame } from '@mine-contexts';
import { useServerCommunication } from '@mine-hooks';
import GridControl from './grid/GridControl';
export const GameBoard = ({ gameAssoc, gameInherited, isEnvDev }) => {
const { gridReady } = useGame();
const { onClick, resign } = useServerCommunication(gameAssoc, gameInherited, isEnvDev);
if (!gridReady) {
return (
<div className="game-overlay">
<div className="game-overlay-window"><h1>Loading</h1></div>
</div>
);
}
return (
<GridControl
gameAssoc={gameAssoc}
onClick={onClick}
resign={resign}
/>
);
};