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

const nameSpace = slice.name;

export const keywordTypeSelector = (state) => state[nameSpace].keywordType;
export const keywordListSelector = (state) => state[nameSpace].keywordList;
export const keywordListLoadingSelector = (state) => state[nameSpace].keywordListLoading;
export const keywordSearchPrefixSelector = (state) => state[nameSpace].keywordSearchPrefix;

export const labelTypeSelector = (state) => state[nameSpace].labelType;
export const labelListSelector = (state) => state[nameSpace].labelList;
export const labelListLoadingSelector = (state) => state[nameSpace].labelListLoading;
export const labelSearchPrefixSelector = (state) => state[nameSpace].labelSearchPrefix;

export const feedDescriptionTypeSelector = (state) => state[nameSpace].feedDescriptionType;
export const feedDescriptionListSelector = (state) => state[nameSpace].feedDescriptionList;
export const feedDescriptionListLoadingSelector = (state) => state[nameSpace].feedDescriptionListLoading;
export const feedDescriptionSearchPrefixSelector = (state) => state[nameSpace].feedDescriptionSearchPrefix;

export const accountTypeSelector = (state) => state[nameSpace].accountType;
export const accountListSelector = (state) => state[nameSpace].accountList;
export const accountListLoadingSelector = (state) => state[nameSpace].accountListLoading;
export const accountSearchPrefixSelector = (state) => state[nameSpace].accountSearchPrefix;

export const hubsTypeSelector = (state) => state[nameSpace].hubsType;
export const hubsListSelector = (state) => state[nameSpace].hubsList;
export const hubsListLoadingSelector = (state) => state[nameSpace].hubsListLoading;
export const hubsSearchPrefixSelector = (state) => state[nameSpace].hubsSearchPrefix;

export const accountGetOwnersSelector = (state) => state[nameSpace].accountGetOwners;

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

  return {
    ...state,
  };
};

export default getCommonState;
