import {createAction} from 'redux-starter-kit';

export const displayConfiguration = createAction('mounts/displayConfiguration');

export const SET_ALLOW_MOUNT = 'mounts/setAllowMount';
export const setAllowMount = (provider, allow) => {
  return {
    type: SET_ALLOW_MOUNT,
    payload: {
      provider,
      allow
    }
  };
};

export const setAutoMountProcessed = createAction('mounts/setAutoMountProcessed');
export const setBusy = createAction('mounts/setBusy');

export const SET_MOUNT_STATE = 'mounts/setMountState';
export const setMountState = (provider, state) => {
  return {
    type: SET_MOUNT_STATE,
    payload: {
      provider,
      state
    }
  };
};

export const SET_MOUNTED = 'mounts/setMounted';
export const setMounted = (provider, mounted) => {
  return {
    type: SET_MOUNTED,
    payload: {
      provider,
      mounted
    }
  };
};

export const SET_PROVIDER_STATE = 'mounts/setProviderState';
export const setProviderState = (provider, state) => {
  return {
    type: SET_PROVIDER_STATE,
    payload: {
      provider,
      state
    }
  }
};