/** * 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 User from './User'; const UserControl = ({ resign }) => { const { webPlayer, activePlayer, mines, foundMines, red, blue, onBombToggle } = useGame(); const activeColor = activePlayer ? 'blue' : 'red'; const resignClass = 'resign' + (activeColor !== webPlayer ? ' disabled' : ''); const minesClass = 'active-mines' + (foundMines ? ' found-mine' : ''); const handleBombClick = (color, player) => { const p = 'red' === color ? red : blue; if (p.haveBomb && p.enabledBomb && activePlayer === player) { onBombToggle(); } }; return (