import { CSSProperties } from 'react'; import friendlyTime from 'friendly-time'; import { gameInfo, outcome } from '../api/api'; var LeftAlignedTableColumn: CSSProperties = { textAlign: "left", paddingLeft: 16 } var RightAlignedTableColumn: CSSProperties = { textAlign: "right", paddingRight: 16 } function GameOutcome(props: { outcome: outcome }) { return { { "w": "Gewonnen", "l": "Verloren", "d": "Gelijkspel" }[props.outcome] } } export default function RecentGames(props: { games?: Array }) { return

Recente partijen

{ props.games?.map(game => ) }
Tegenstander Uitkomst Zetten Datum
{game.opponent.username} {game.moves.length -1} {(() => { var timeCreated = new Date(game.created); return friendlyTime(timeCreated); })()}
}