import { GameSelectors, useAppSelector } from '@app/store'; import { cx } from '@app/utils'; import './PlayerList.css'; export interface PlayerListProps { gameId: number | undefined; } function PlayerList({ gameId }: PlayerListProps) { const players = useAppSelector((state) => gameId != null ? GameSelectors.getPlayers(state, gameId) : undefined, ); const activePlayerId = useAppSelector((state) => gameId != null ? GameSelectors.getActivePlayerId(state, gameId) : undefined, ); const hostId = useAppSelector((state) => gameId != null ? GameSelectors.getHostId(state, gameId) : undefined, ); const entries = players ? Object.values(players) : []; return (