import type { ReactNode } from 'react' import Entity from '../entity/entity' import AbstractChoices from '../abstract-choices/abstract-choices' import GameStatus from '../game-status/game-status' import { GameProvider } from '../../contexts/game-context' import type { GameEntity, GameserverConnection } from '../../types' export default function Game ({ gameConnection, loading, isSpectator, }: { gameConnection?: GameserverConnection | Record | null loading?: ReactNode isSpectator?: boolean }) { const G = gameConnection && 'state' in gameConnection ? (gameConnection as unknown as GameserverConnection).state?.G as | { sharedBoard: { entities: GameEntity[] }; personalBoards?: { entities: GameEntity[] }[] } | undefined : undefined return G ? (
{G.sharedBoard.entities.map((entity, i) => )}
{G.personalBoards && (
{G.personalBoards.map((board, i) => (
{board.entities.map((entity, j) => ( ))}
))}
)}
) : loading }