import { slice } from '../slices';

const nameSpace = slice.name;

export const configSelector = (state) => state[nameSpace].config;
export const configCopySelector = (state) => state[nameSpace].configCopy;
export const isMoreFiltersOpenedSelector = (state) => state[nameSpace].isMoreFiltersOpened;
export const isFilterDirtySelector = (state) => state[nameSpace].isFilterDirty;
export const isInsightsModeSelector = (state) => state[nameSpace].isInsightsMode;
export const restoreConfigSelector = (state) => state[nameSpace].restoreConfig;
export const defaultEmptyFilterOrderSelector = (state) => state[nameSpace].defaultEmptyFilterOrder;
export const tabCountersSelector = (state) => state[nameSpace].tabCounters;

export const getCommonState = (state$) => {
  const state = state$[nameSpace];

  return {
    ...state,
  };
};

export default getCommonState;
