+ {
+ gameState.CurrentCard &&
+
+ }
+ {
+ gameState.Hand &&
+
+ }
+
+ {
+ gameState.Players &&
+ gameState.Players.map((player, index) => {
+ const isCurrentPlayer = player === gameState.CurrentPlayer;
+ const isMe = player === gameState.PlayerName;
+ return -
+ {player} {isMe && '(You)'}
+
+ })
+ }
+
+
+ )
+}
+
+export default Game;
\ No newline at end of file
diff --git a/src/layout/pages/Room.tsx b/src/layout/pages/Room.tsx
index fa1e076..c11db28 100644
--- a/src/layout/pages/Room.tsx
+++ b/src/layout/pages/Room.tsx
@@ -3,8 +3,7 @@ import React from "react";
import {useNavigate, useParams} from "react-router";
import {GHButton} from "../components/Button";
import useTitle from "../../utils/hooks/TitleHook";
-import Hand from "../components/Hand";
-import Deck from "../components/Deck";
+import Game from "../components/Game";
interface GameState {
PlayerName: string;
@@ -14,6 +13,16 @@ interface GameState {
Players: string[];
}
+interface ChatMessage {
+ PlayerName: string;
+ Message: string;
+}
+
+interface SocketMessage {
+ Type: string;
+ Payload: any;
+}
+
const Room = () => {
useTitle('Mau!');
@@ -31,6 +40,8 @@ const Room = () => {
CurrentPlayer: '',
Players: []
});
+ const [chatMessages, setChatMessages] = React.useState