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 statusSelector = (state) => state[nameSpace].status;
export const nameSelector = (state) => state[nameSpace].name;
export const siteSelector = (state) => state[nameSpace].site;
export const scheduleReportSelector = (state) => state[nameSpace].scheduleReport;
export const enableInstantDeliverySelector = (state) => state[nameSpace].enableInstantDelivery;
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 triggerSelector = (state) => state[nameSpace].trigger;
export const medataFormIdSelector = (state) => state[nameSpace].medataFormId;
export const autocompleteSelector = (state) => state[nameSpace].autocomplete;
export const isFormDownloadInProgressSelector = (state) => state[nameSpace].isFormDownloadInProgress;
export const shouldShowDownloadTryRequestOverConfirmSelector = (state) =>
  state[nameSpace].shouldShowDownloadTryRequestOverConfirm;
export const formDownloadTryRequestCounterSelector = (state) => state[nameSpace].formDownloadTryRequestCounter;

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