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 statusSelector = (state) => state[nameSpace].status;
export const searchSelector = (state) => state[nameSpace].search;
export const accountSelector = (state) => state[nameSpace].account;
export const accountOptionsSelector = (state) => state[nameSpace].accountOptions;

export const departmentSelector = (state) => state[nameSpace].department;
export const departmentOptionsSelector = (state) => state[nameSpace].departmentOptions;

export const roleSelector = (state) => state[nameSpace].role;
export const roleOptionsSelector = (state) => state[nameSpace].roleOptions;

export const apiSetSelector = (state) => state[nameSpace].apiSet;
