import useGame from "@/hook/useGame"; import { RedButton } from "../util/button"; import { useEffect, useRef } from "react"; import Image from "next/image"; export function EnemyTeamModal({ visible, onClose }) { const { teamId, enemyName } = useGame(); const imageRef = useRef(null); useEffect(() => { if (visible) { refreshImage(); } }, [visible]); function refreshImage() { imageRef.current.src = SERVER_URL + "/photo/enemy?team=" + teamId.toString() + "&t=" + new Date().getTime(); } const SERVER_URL = "https://" + process.env.NEXT_PUBLIC_SOCKET_HOST + ":" + process.env.NEXT_PUBLIC_SOCKET_PORT; return (visible && <>

{enemyName}

Close
) }