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

import { slice } from '../slices';
import createFormSelector from '@/modules/@common/Form/redux/selectors';

const nameSpace = slice.name;
const formSelectors = createFormSelector(REDUX_FIELD_NAME, nameSpace);

export const idSelector = (state) => state[nameSpace].id;
export const nameSelector = (state) => state[nameSpace].name;
export const advertiserSelector = (state) => state[nameSpace].advertiser;
export const advertiserOptionsSelector = (state) => state[nameSpace].advertiserOptions;
export const hubSelector = (state) => state[nameSpace].hub;
export const hubOptionsSelector = (state) => state[nameSpace].hubOptions;
export const activeTabIdSelector = (state) => state[nameSpace].activeTabId;

// forms
export const scrollFieldSelector = (state) => formSelectors.getScrollField(state);
export const schemeSelector = (state) => formSelectors.schemeSelector(state);
export const fullAccessToStoreFieldsForValidation = (state) => state[nameSpace];
