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 displayNameSelector = (state) => state[nameSpace].displayName;
export const typeSelector = (state) => state[nameSpace].type;
export const accountSelector = (state) => state[nameSpace].account;
export const accountOptionsSelector = (state) => state[nameSpace].accountOptions;
export const defaultPageSelector = (state) => state[nameSpace].defaultPage;
export const visibleInSelfServeSelector = (state) => state[nameSpace].visibleInSelfServe;
export const readOnlyInSelfServeSelector = (state) => state[nameSpace].readOnlyInSelfServe;
export const permissionsSelector = (state) => state[nameSpace].permissions;
export const permissionsModulesSelector = (state) => state[nameSpace].permissionsModules;

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];
