import { useEffect, useState } from "react"; import { MapBuilder } from "../../scripts/main/MapBuilder.js"; import styles from "./Draw.module.css"; import RoomModal from "../../components/RoomModal/RoomModal.jsx"; import SideBar from "../../components/SideBar/SideBar.jsx"; import EntranceModal from "../../components/EntranceModal/EntranceModal.jsx"; import DrawGuide from "../../components/DrawGuide/DrawGuide.jsx"; import RoomTypeModal from "../../components/RoomTypeModal/RoomTypeModal.jsx"; import InfoPinModal from "../../components/InfoPinModal/InfoPinModal.jsx"; import HttpService from "../../scripts/net/HttpService.js"; import SaveMap from "../../components/SaveMap/SaveMap.jsx"; import logo from "../../assets/logo_icon.png"; import MapTemplateSelector from "../../components/MapTemplateSelector/LoadMap.jsx"; import KeymapPanel from "../../components/KeyMappingsGuidePanel/KeymapPanel.jsx"; import { Link } from "react-router-dom"; function Draw() { const [selectedFloor, setSelectedFloor] = useState(1); const [app, setApp] = useState(null); const [isPopupVisible, setIsPopupVisible] = useState(false); useEffect(() => { const app = new MapBuilder("container"); setApp(app); // fpsCounterLoop(); }, []); const handleFloorChange = (event) => { setSelectedFloor(event.target.value); console.log(`Floor changed to: ${event.target.value}`); }; const handleRenderClick = () => { setIsPopupVisible(true); setTimeout(() => { setIsPopupVisible(false); }, 3000); }; const handleSaveClick = async (mapName) => { const resp = await app.saveMap(mapName); }; const handleLoadMapClick = (data) => { app.deserializeMap(data); }; return (
Finki Logo

Map Builder

{/*

*/}
{/*
*/} {/*

Objects:

*/}
{isPopupVisible && (

Map Rendered!

Your map has been successfully rendered.

)}
); } export default Draw;