import { createSelector } from 'reselect';
import { fromJS } from 'immutable';

// New selectors for MobilePushNew
const selectMobilePushNewDomain = () => (state) => state.get('mobilePushNew') || fromJS({});

const makeSelectMobilePushNew = () => createSelector(
  selectMobilePushNewDomain(),
  (substate) => substate.toJS()
);

const makeSelectUploadedAssetData = () => createSelector(
  selectMobilePushNewDomain(),
  (substate) => substate.get('uploadedAssetData') || {}
);

const makeSelectUploadedAssetData0 = () => createSelector(
  selectMobilePushNewDomain(),
  (substate) => substate.get('uploadedAssetData0') || {}
);

const makeSelectUploadedAssetData1 = () => createSelector(
  selectMobilePushNewDomain(),
  (substate) => substate.get('uploadedAssetData1') || {}
);

const makeSelectUploadAssetSuccess = () => createSelector(
  selectMobilePushNewDomain(),
  (substate) => substate.get('uploadAssetSuccess') || false
);

const makeSelectCreateError = () => createSelector(
  selectMobilePushNewDomain(), (dimensionState) => dimensionState.get('createTemplateErrorMessage') || ""
);

const makeSelectAssetUploading = () => createSelector(
  selectMobilePushNewDomain(),
  (substate) => substate.get('assetUploading') || false
);

const makeSelectGetTemplateDetailsInProgress = () => createSelector(
  selectMobilePushNewDomain(),
  (substate) => substate.get('getTemplateDetailsInProgress') || false
);

export {
  makeSelectMobilePushNew,
  makeSelectUploadedAssetData,
  makeSelectUploadedAssetData0,
  makeSelectUploadedAssetData1,
  makeSelectUploadAssetSuccess,
  makeSelectCreateError,
  makeSelectAssetUploading,
  makeSelectGetTemplateDetailsInProgress,
};
