/* // hooks/useWdmMarkersLayer.js
import { useEffect, useState } from "react";
import L from "leaflet";
import { addContextMenuToMarker } from "../../utils/addContextMenuToMarker";
import { createAndSetDevices } from "../../utils/createAndSetDevices";

const useWdmMarkersLayer = (map, oms, GisSystemStatic, priorityConfig) => {
  const [wdmMarkers, setWdmMarkers] = useState([]);

  useEffect(() => {
    if (GisSystemStatic && GisSystemStatic.length && map) {
      createAndSetDevices(10, setWdmMarkers, GisSystemStatic, priorityConfig); // WDM
    }
  }, [GisSystemStatic, map, priorityConfig]);

  useEffect(() => {
    if (map && wdmMarkers.length) {
      wdmMarkers.forEach((marker) => {
        marker.addTo(map);
        oms.addMarker(marker);

        // Popup on mouseover and mouseout
        marker.on("mouseover", function () {
          this.openPopup();
        });
        marker.on("mouseout", function () {
          this.closePopup();
        });

        addContextMenuToMarker(marker);
      });

      // Disable map context menu
      map.options.contextmenu = false;
      map.options.contextmenuItems = [];

      oms.map.options.contextmenu = false;
      oms.map.options.contextmenuItems = [];
    }
  }, [map, wdmMarkers, oms]);

  return wdmMarkers;
};

export default useWdmMarkersLayer;
 */
