import { TYPE_ALL } from '../constants';

import * as selectors from '../redux/selectors';

export const shouldShowEmpty = (state) => {
  const data = selectors.dataSelector(state);
  const page = selectors.pageSelector(state);
  const search = selectors.searchSelector(state);
  const status = selectors.typeSelector(state);
  const isLoading = selectors.isLoadingSelector(state);

  return !isLoading && Array.isArray(data) && !data.length && page === 1 && !search && status === TYPE_ALL;
};

export default {};
