|
@@ -0,0 +1,27 @@
|
|
|
+import { useCurrentRound, usePlayerName } from "../../../domain/gameStore";
|
|
|
+import { usePlayers } from "../../../hooks/useGameInfo";
|
|
|
+import styles from "./GamePanel.module.css";
|
|
|
+
|
|
|
+const Standings = () => {
|
|
|
+ const playerName = usePlayerName();
|
|
|
+ const round = useCurrentRound();
|
|
|
+ const players = usePlayers();
|
|
|
+ const filtered = players?.filter(({ name }) => name !== playerName);
|
|
|
+
|
|
|
+ return (
|
|
|
+ <div className={styles.standings}>
|
|
|
+ <div>
|
|
|
+ <span className={styles.standingsName}>{playerName}</span>- Round{" "}
|
|
|
+ {round}
|
|
|
+ </div>
|
|
|
+ {filtered?.map(({ name, currentRound }) => (
|
|
|
+ <div key={name}>
|
|
|
+ <span className={styles.standingsName}>{name}</span>- Round{" "}
|
|
|
+ {currentRound}
|
|
|
+ </div>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+};
|
|
|
+
|
|
|
+export default Standings;
|