// /hooks/useCreateAndSetDevices.js
import { useEffect } from "react";
import { createAndSetDevices } from "../utils/createAndSetDevices";
import { useSelector } from "react-redux";

const useCreateAndSetDevices = (systemId, setMarkersFunction, GisSystemStatic, priorityConfig) => {
  const polylineEventsDisabled = useSelector((state) => state.polylineEventsDisabled.disabled);

  useEffect(() => {
    createAndSetDevices(systemId, setMarkersFunction, GisSystemStatic, priorityConfig, polylineEventsDisabled);
  }, [systemId, setMarkersFunction, GisSystemStatic, priorityConfig, polylineEventsDisabled]);
};

export default useCreateAndSetDevices;
