import { createSelector } from 'reselect';

/**
 * Direct selector to the creativesContainer state domain
 */
const selectCreativesContainerDomain = () => (state) => state.get('creativesContainer');

/**
 * Other specific selectors
 */


/**
 * Default selector used by CreativesContainer
 */

const makeSelectCreativesContainer = () => createSelector(
  selectCreativesContainerDomain(),
  (substate) => substate?.toJS()
);
const isLoading = () => createSelector(
  makeSelectCreativesContainer(),
  (substate) => substate?.containerLoader
);
const loyaltyTagProps = () => createSelector(
  makeSelectCreativesContainer(),
  (substate) => substate?.loyaltyTagProps
);

export default makeSelectCreativesContainer;
export {
  selectCreativesContainerDomain,
  isLoading,
  loyaltyTagProps,
};
