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

/**
 * Direct selector to the create state domain
 */
const selectPushMessageCreateDomain = () => (state) => state.get('mobileCreate') || fromJS({});
/**
 * Other specific selectors
 */


/**
 * Default selector used by Create
 */

const makeSelectCreate = () => createSelector(
  selectPushMessageCreateDomain(),
  (substate) => substate.toJS()
);

const makeSelectCreateResponse = () => createSelector(
  selectPushMessageCreateDomain(), (dimensionState) => dimensionState.get('response')
);

const makeSelectIosCta = () => createSelector(makeSelectCreate(), (create) => create.getIosCtasSucccess && create.iosCtasData );
export {
  makeSelectCreate, makeSelectCreateResponse, makeSelectIosCta,
};
