import { useGame } from '../../contexts/game-context' import Entity from '../entity/entity' import type { GameEntity } from '../../types' export default function Space ({ space }: { space: GameEntity }) { const { clickTarget, allClickable, currentMoveTargets } = useGame() const { entities, entityId } = space.attributes const entityList = entities ?? [] const clickable = allClickable.has(space) const targeted = currentMoveTargets .map((e) => (e as GameEntity).entityId ?? (e as GameEntity).attributes?.entityId) .includes(entityId) return ( clickTarget(space)} style={{ display: 'inline-block', flex: '1', }} >
{Array.from({ length: entityList.length }, (_, i) => (
))} {!entityList.length && String(space.attributes.name ?? '')}
) }