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,
  allRecordsCountSelector,
} = createTableSelector(TABLE_REDUX_FIELD_NAME, slice.name);

/// FILTERS ///
export const searchSelector = (state) => state[nameSpace].search;
export const typeSelector = (state) => state[nameSpace].type;
export const typesOptionsSelector = (state) => state[nameSpace].typesOptions;
export const publisherSelector = (state) => state[nameSpace].publisher;
export const publishersOptionsSelector = (state) => state[nameSpace].publishersOptions;

/// ROW ACTIONS ///
export const embedCodeSelector = (state) => state[nameSpace].embedCode;
export const aspectRatioSelector = (state) => state[nameSpace].aspectRatio;

/// ADDITION ///
export const newPlayerTypeSelector = (state) => state[nameSpace].newPlayerType;
