import { type Cell, tttWinningLine } from '@chat-app/shared/chat'; interface Props { board: Cell[]; myPlayerIdx: 0 | 1 | null; disabled: boolean; onMove: (cell: number) => void; } const MARK = ['×', '○'] as const; export function TicTacToeBoard({ board, myPlayerIdx, disabled, onMove }: Props) { const winLine = tttWinningLine(board); const winSet = new Set(winLine ?? []); return (
{board.map((cell, i) => { const filled = cell !== null; const inWin = winSet.has(i); const canClick = !disabled && !filled && myPlayerIdx !== null; return ( ); })}
); }