import React, { useState, useEffect, useRef } from 'react'; import { motion } from 'framer-motion'; import { io } from 'socket.io-client'; import { ServerOff, Map } from 'lucide-react'; const WorldMapPage = ({ isMobile = false }) => { const [serverOnline, setServerOnline] = useState(null); // null = loading, true/false = 상태 const socketRef = useRef(null); useEffect(() => { // 소켓 연결하여 서버 상태 확인 const socket = io('/', { path: '/socket.io', transports: ['websocket', 'polling'] }); socketRef.current = socket; socket.on('status', (data) => { setServerOnline(data.online); }); return () => { socket.disconnect(); }; }, []); // 로딩 중 if (serverOnline === null) { return (

서버 상태 확인 중...

); } // 서버 오프라인 if (!serverOnline) { return (

서버 오프라인

마인크래프트 서버가 현재 오프라인 상태입니다.
서버가 시작되면 월드맵을 확인할 수 있습니다.

월드맵 이용 불가
); } // 서버 온라인 - BlueMap 표시 return (
{/* BlueMap iframe - 전체 화면 */}