import React from "react"; import useTitle from "../../utils/hooks/TitleHook"; import Card from "../components/Card"; import {useNavigate} from "react-router"; import {NoButton} from "../components/Button"; const ROOM_URL = `${process.env.REACT_APP_API_URL}/room`; const MainLobby = () => { useTitle('Mau-Mau Lobby'); const navigateTo = useNavigate(); const playerName = localStorage.getItem('playerName') ?? ""; const handleCreateRoom = () => { fetch(ROOM_URL, { method: 'POST', }).then(res => res.json()).then(room => { navigateTo(`/room/${room}`); }); } const changePlayerName = (name: string) => { if (!name) return; localStorage.setItem('playerName', name); } return (