1- import { type ReactElement , memo , useCallback , useMemo , useState , useEffect } from 'react' ;
1+ import { type ReactElement , memo , useCallback , useEffect , useMemo , useState } from 'react' ;
22
33import { Table } from '@/web/react/components/board' ;
44
@@ -15,8 +15,11 @@ type Board = (null | 'W' | 'B')[][];
1515type GameState = { board : Board ; sinceLast : number | null ; at : Date ; score : { W : number ; B : number } } ;
1616
1717const Cell : CellRenderer < 'W' | 'B' | null > = ( { cell } ) => (
18- < td className = "h-8 w-8 bg-green-600 border-collapse border border-primary leading-0" >
19- { cell ? < span className = { `${ cell === 'W' ? 'bg-white' : 'bg-black' } h-7 w-7 inline-block rounded-full m-0.5` } /> : null }
18+ < td className = "bg-green-600 border-collapse border border-primary leading-0" >
19+ < span
20+ className = "h-7 w-7 inline-block rounded-full m-0.5"
21+ style = { { backgroundColor : cell ? ( cell === 'W' ? 'white' : 'black' ) : undefined } }
22+ />
2023 </ td >
2124) ;
2225const Board = memo ( ( { state } : { state : GameState } ) => (
@@ -71,7 +74,7 @@ const BoardWrapper = memo(({ states, game }: { states: GameState[]; game: GameMo
7174 Start
7275 </ button >
7376 < button onClick = { previous } disabled = { ! canPrevious } >
74- Previous
77+ Prev
7578 </ button >
7679 < button onClick = { next } disabled = { ! canNext } >
7780 Next
@@ -83,7 +86,7 @@ const BoardWrapper = memo(({ states, game }: { states: GameState[]; game: GameMo
8386 ) ;
8487
8588 return (
86- < div className = "flex flex-col items-center max-w-3xl m-10" >
89+ < div className = "flex flex-col items-center m-10" >
8790 < h1 >
8891 { game . players . B . name } (Black) vs { game . players . W . name } (White) < small className = "text-secondary" > in { game . room } </ small >
8992 </ h1 >
0 commit comments