import { useEffect, useState } from "react"; import { Circle } from "react-leaflet"; import "leaflet/dist/leaflet.css"; import { BlueButton, GreenButton, RedButton } from "@/components/button"; import { CustomMapContainer, MapEventListener } from "@/components/map"; import { TextInput } from "@/components/input"; import useAdmin from "@/hook/useAdmin"; import useMapCircleDraw from "@/hook/useMapCircleDraw"; import useLocalVariable from "@/hook/useLocalVariable"; const EditMode = { MIN: 0, MAX: 1 } function Drawings({ minZone, setMinZone, maxZone, setMaxZone, editMode }) { const { center: maxCenter, radius: maxRadius, handleLeftClick: maxLeftClick, handleRightClick: maxRightClick, handleMouseMove: maxHover } = useMapCircleDraw(maxZone, setMaxZone); const { center: minCenter, radius: minRadius, handleLeftClick: minLeftClick, handleRightClick: minRightClick, handleMouseMove: minHover } = useMapCircleDraw(minZone, setMinZone); function handleLeftClick(e) { if (editMode == EditMode.MAX) { maxLeftClick(e); } else { minLeftClick(e); } } function handleRightClick(e) { if (editMode == EditMode.MAX) { maxRightClick(e); } else { minRightClick(e); } } function handleMouseMove(e) { if (editMode == EditMode.MAX) { maxHover(e); } else { minHover(e); } } return (
Reduction number
Zone duration
Timeout