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 advertiserSelector = (state) => state[nameSpace].advertiser;
export const hubSelector = (state) => state[nameSpace].hub;

// autocomplete options
export const advertiserOptionsSelector = (state) => state[nameSpace].advertiserOptions;
export const hubOptionsSelector = (state) => state[nameSpace].hubOptions;
