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,
  selectedSelector,
  isLoadingSelector,
} = createTableSelector(TABLE_REDUX_FIELD_NAME, nameSpace);

// filters
export const searchSelector = (state) => state[nameSpace].search;
export const statusSelector = (state) => state[nameSpace].status;
export const typeSelector = (state) => state[nameSpace].type;
