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

import { slice } from '../slices';
import createTableSelector from '@/modules/@common/Table/redux/selectors';

const nameSpace = slice.name;

// table
export const {
  dataSelector,
  pageSelector,
  pageSizeSelector,
  totalCountSelector,
  sortBySelector,
  sortOrderSelector,
  isLoadingSelector,
} = createTableSelector(TABLE_REDUX_FIELD_NAME, nameSpace);

// filters
export const searchSelector = (state) => state[nameSpace].search;
export const categorySelector = (state) => state[nameSpace].category;
export const accountSelector = (state) => state[nameSpace].account;
export const accountOptionsSelector = (state) => state[nameSpace].accountOptions;
export const languagesSelector = (state) => state[nameSpace].languages;
export const xrayStatusSelector = (state) => state[nameSpace].xrayStatus;
export const tagStatusSelector = (state) => state[nameSpace].tagStatus;
export const imageSelector = (state) => state[nameSpace].image;

// loader
export const isMergeLoadingSelector = (state) => state[nameSpace].isMergeLoading;
