/** * 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 { Fragment, useState } from 'react'; import { OnlinePlayersDialog } from '@mine-components'; import { bool, string } from 'prop-types'; const WaitingOverlayContent = ({ shareUrl, currentGameAssoc, opponentName = '', inviteOnly = false }) => { const [dialogOpen, setDialogOpen] = useState(false); const inviteHeader = inviteOnly && opponentName ? `Invite ${opponentName}` : 'Invite a Friend'; return (
{inviteHeader}

Share this link with your opponent

{!inviteOnly && (
OR
Challenge a Player

Browse online players and challenge them

)}
{!inviteOnly && ( setDialogOpen(false)} currentGameAssoc={currentGameAssoc} /> )}
); }; const ShareLinkBox = ({ url }) => { const [copied, setCopied] = useState(false); const handleCopy = () => { navigator.clipboard.writeText(url) .then(() => { setCopied(true); setTimeout(() => setCopied(false), 2500); }) .catch(() => null); }; return (
e.currentTarget.querySelector('input').select()}> e.target.select()} />
); }; export default WaitingOverlayContent; WaitingOverlayContent.propTypes = { shareUrl: string.isRequired, currentGameAssoc: string, opponentName: string, inviteOnly: bool, };