colored & linked name for registered users

This commit is contained in:
Nathaniel Tampus
2023-04-05 23:37:07 +08:00
parent d01bb43004
commit 8d7ad6161f
3 changed files with 70 additions and 9 deletions

View File

@@ -24,8 +24,18 @@ export default async function PublicGames() {
{games && games.length > 0 ? (
games.map((game) => (
<tr key={game.code} className="group">
<td>{game.host?.name}</td>
<td>
<td className={typeof game.host?.id === "number" ? "text-primary" : ""}>
{game.host?.name}
</td>
<td
className={
typeof (game.host?.id === game.white?.id
? game.black?.id
: game.white?.id) === "number"
? "text-primary"
: ""
}
>
{(game.host?.id === game.white?.id ? game.black?.name : game.white?.name) || ""}
</td>
<th>