import { STATUSES_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 account = selectors.accountSelector(state);
  const status = selectors.statusSelector(state);
  const isLoading = selectors.isLoadingSelector(state);

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

export default {};
