import { memo } from 'react'; import type { PlayerState } from '../net/types'; import type { ItemFlash } from '../net/useGameConnection'; import { EffectTimers } from './EffectTimers'; import { BoardCanvas } from './BoardCanvas'; import { ItemBar } from './ItemBar'; import { ItemFlashOverlay } from './ItemFlashOverlay'; import styles from './MiniBoard.module.css'; interface Props { state: PlayerState; width: number; height: number; /** Number key that targets this player, if any. */ slot?: number; selected: boolean; flashes: ItemFlash[]; cell: number; } /** Small view of an opponent: board, name, target key and their current items. */ export const MiniBoard = memo(function MiniBoard({ state, width, height, slot, selected, flashes, cell }: Props) { return (
{slot !== undefined && {slot}} {state.name}
{state.alive && ( )}
); });