import { useLocalStore } from 'mobx-react-lite';
import { axios } from '@choerodon/boot';
export default function useStore() {
  return useLocalStore(function () {
    return {
      navBounds: {},
      setNavBounds: function setNavBounds(data) {
        this.navBounds = data;
      },

      get getNavBounds() {
        return this.navBounds;
      },

      checkEffect: function checkEffect(projectId, id) {
        return axios.get("/devops/v1/projects/".concat(projectId, "/envs/").concat(id, "/delete_check"));
      },
      checkStatus: function checkStatus(projectId, id) {
        return axios.get("/devops/v1/projects/".concat(projectId, "/envs/").concat(id, "/info"));
      },
      effectEnv: function effectEnv(projectId, id, target) {
        return axios.put("/devops/v1/projects/".concat(projectId, "/envs/").concat(id, "/active?active=").concat(target));
      },
      deleteEnv: function deleteEnv(projectId, id) {
        return axios["delete"]("/devops/v1/projects/".concat(projectId, "/envs/").concat(id));
      },
      checkDelete: function checkDelete(projectId, id) {
        return axios.get("/devops/v1/projects/".concat(projectId, "/envs/").concat(id, "/delete_check"));
      },
      checkStop: function checkStop(projectId, id) {
        return axios.get("/devops/v1/projects/".concat(projectId, "/envs/").concat(id, "/disable_check"));
      }
    };
  });
}