"use client"; // all of this in a client component for now to easily handle socket events import { Chessboard } from "react-chessboard"; import { IconCopy } from "@tabler/icons-react"; import { useState, useEffect } from "react"; import Image from "next/image"; import { Game } from "@chessu/types"; import { io } from "socket.io-client"; import { API_URL } from "@/config"; const socket = io(API_URL, { withCredentials: true, autoConnect: true }); const pgn = "1. e4 e5 2. f3 Nf6 3. d4 exd4 4. Qxd4 Nxe4 5. Qxe4+ Qe7 6. Qxe7+"; export default function GameWrapper({ initialLobby }: { initialLobby: Game }) { const [lobbyData, setLobbyData] = useState(initialLobby); // TODO return (
| {i + 1}. | {moves[0]} | {moves[1]} |