import { useState } from "react"; import LocationIcon from "zy-react-library/components/Icon/LocationIcon"; import MapSelector from "zy-react-library/components/Map/MapSelector"; function BaiduMap({ longitude, latitude, disable = true, onChange, onConfirm, enablePointSelect, onPointSelect, }) { const [mapVisible, setMapVisible] = useState(false); const [selectedLocation, setSelectedLocation] = useState({ longitude: "", latitude: "", }); const currentLongitude = longitude || selectedLocation.longitude; const currentLatitude = latitude || selectedLocation.latitude; const mapDisabled = disable && !enablePointSelect; const handleConfirm = (nextLongitude, nextLatitude, extra) => { setSelectedLocation({ longitude: nextLongitude, latitude: nextLatitude, }); onPointSelect?.(nextLongitude, nextLatitude, extra); onChange?.(nextLongitude, nextLatitude, extra); onConfirm?.(nextLongitude, nextLatitude, extra); setMapVisible(false); }; return (