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

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

const nameSpace = slice.name;

export const idSelector = (state) => state[nameSpace].id;
export const nameSelector = (state) => state[nameSpace].name;
export const categorySelector = (state) => state[nameSpace].category;
export const categoryOptionsSelector = (state) => state[nameSpace].categoryOptions;
export const accountSelector = (state) => state[nameSpace].account;
export const imageSelector = (state) => state[nameSpace].image;
export const titleSelector = (state) => state[nameSpace].title;
export const descriptionSelector = (state) => state[nameSpace].description;
export const dynamicFieldsSelector = (state) => state[nameSpace].dynamicFields;
export const submitButtonSelector = (state) => state[nameSpace].submitButton;
export const privacyPolicySelector = (state) => state[nameSpace].privacyPolicy;
export const termsConditionsSelector = (state) => state[nameSpace].termsConditions;
export const skipButtonSelector = (state) => state[nameSpace].skipButton;
export const styleSelector = (state) => state[nameSpace].style;
export const autocompleteSelector = (state) => state[nameSpace].autocomplete;
export const activeTabIdSelector = (state) => state[nameSpace].activeTabId;

const formSelectors = createFormSelector(FORM_REDUX_FIELD_NAME, nameSpace);

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