fix(ssr): fix no players msg showing if there's no search
All checks were successful
deploy / deploy (push) Successful in 1m5s

This commit is contained in:
Lee 2023-11-09 20:01:28 +00:00
parent 350fe875fe
commit 426a2b5a2f

@ -80,26 +80,24 @@ export default function SearchPlayer() {
players ? "flex" : "hidden", players ? "flex" : "hidden",
)} )}
> >
{players && players.length > 0 ? ( {players && players.length > 0
players.map((player: ScoresaberPlayer) => ( ? players.map((player: ScoresaberPlayer) => (
<Link <Link
key={player.id} key={player.id}
className="flex min-w-[14rem] items-center gap-2 p-2 transition-all hover:bg-background" className="flex min-w-[14rem] items-center gap-2 p-2 transition-all hover:bg-background"
href={`/player/${player.id}/top/1`} href={`/player/${player.id}/top/1`}
> >
<Avatar label="Account" size={40} url={player.profilePicture} /> <Avatar label="Account" size={40} url={player.profilePicture} />
<div> <div>
<p className="text-xs text-gray-400"> <p className="text-xs text-gray-400">
#{formatNumber(player.rank)} #{formatNumber(player.rank)}
</p> </p>
<p className="text-sm">{player.name}</p> <p className="text-sm">{player.name}</p>
</div> </div>
</Link> </Link>
)) ))
) : ( : search.length > 0 && <div className="p-2">No players found</div>}
<div className="p-2">No players found</div>
)}
</div> </div>
</form> </form>
); );