render players conditionally
This commit is contained in:
parent
4fc8a4036d
commit
bb2ab1014e
|
@ -181,25 +181,29 @@ export default function Index() {
|
|||
<h1 className="text-center text-4xl tracking-tighter text-ctp-subtext0">
|
||||
{county.name}
|
||||
</h1>
|
||||
<table className="text-left">
|
||||
<thead>
|
||||
<tr className="border-b border-ctp-surface2 text-ctp-subtext1">
|
||||
<th className="p-2">Player</th>
|
||||
<th className="p-2">Rank</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{county.players.map((player) => (
|
||||
<tr
|
||||
key={player.id}
|
||||
className="border-b border-ctp-surface2 odd:bg-ctp-surface0 even:bg-ctp-surface1"
|
||||
>
|
||||
<td className="p-2">{player.playerName}</td>
|
||||
<td className="p-2">#{player.rank}</td>
|
||||
{county?.players.length > 0 ? (
|
||||
<table className="text-left">
|
||||
<thead>
|
||||
<tr className="border-b border-ctp-surface2 text-ctp-subtext1">
|
||||
<th className="p-2">Player</th>
|
||||
<th className="p-2">Rank</th>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody>
|
||||
{county.players.map((player) => (
|
||||
<tr
|
||||
key={player.id}
|
||||
className="border-b border-ctp-surface2 odd:bg-ctp-surface0 even:bg-ctp-surface1"
|
||||
>
|
||||
<td className="p-2">{player.playerName}</td>
|
||||
<td className="p-2">#{player.rank}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
) : (
|
||||
<p className="text-center">no players here yet :(</p>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
|
Loading…
Reference in New Issue