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

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

const nameSpace = slice.name;

export const accountSelector = (state) => state[nameSpace].account;
export const accountOptionsSelector = (state) => state[nameSpace].accountOptions;

export const contentOwnerSelector = (state) => state[nameSpace].contentOwner;
export const contentOwnersOptionsSelector = (state) => state[nameSpace].contentOwnersOptions;

export const idSelector = (state) => state[nameSpace].id;
export const emailSelector = (state) => state[nameSpace].email;
export const firstNameSelector = (state) => state[nameSpace].firstName;
export const lastNameSelector = (state) => state[nameSpace].lastName;
export const statusSelector = (state) => state[nameSpace].status;
export const timezoneSelector = (state) => state[nameSpace].timezone;
export const timezoneOptionsSelector = (state) => state[nameSpace].timezoneOptions;
export const roleSelector = (state) => state[nameSpace].role;
export const roleOptionsSelector = (state) => state[nameSpace].roleOptions;
export const enable2faSelector = (state) => state[nameSpace].enable2fa;
export const defaultHubSelector = (state) => state[nameSpace].defaultHub;
export const publisherIdsSelector = (state) => state[nameSpace].publisherIds;
export const departmentSelector = (state) => state[nameSpace].department;
export const departmentOptionsSelector = (state) => state[nameSpace].departmentOptions;
export const allSitesSelector = (state) => state[nameSpace].allSites;
export const sendInviteSelector = (state) => state[nameSpace].sendInvite;
export const updateDateSelector = (state) => state[nameSpace].updateDate;
export const updatedBySelector = (state) => state[nameSpace].updatedBy;

export const initialRoleTypeSelector = (state) => state[nameSpace].initialRoleType;
export const initialRoleNameSelector = (state) => state[nameSpace].initialRoleName;
export const initialEmailSelector = (state) => state[nameSpace].initialEmail;
export const initialStatusSelector = (state) => state[nameSpace].initialStatus;

export const activeTabIdSelector = (state) => state[nameSpace].activeTabId;

const formSelectors = createFormSelector(REDUX_FIELD_NAME, nameSpace);

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