import type { SetStateAction } from "react"; import { createRef, createContext } from "react"; import type { IComponentBaseProps } from "#package/types"; import type { TOptionType, TSelectCtx, TSelectValue } from "../config/types"; export const SelectContext = createContext({ form: undefined, formatCount: undefined, formatOptionLabel: undefined, getOptionsModify: undefined, isAsync: undefined, isAutoScroll: undefined, isCheckboxView: undefined, isCountView: undefined, isDisabled: undefined, isMulti: undefined, isRequired: undefined, isSearchable: undefined, name: undefined, getCN: (el?: string, mod?: IComponentBaseProps["extraClasses"], utilClasses?: string[]) => "", icons: {}, stateActions: { setSelectValue: (value: SetStateAction) => {}, setSelectOptions: (value: SetStateAction) => {}, setSelectDisabled: (value: SetStateAction) => {}, setSelectLoading: (value: SetStateAction) => {}, setSelectRequired: (value: SetStateAction) => {}, setSelectIsOpen: (value: SetStateAction) => {}, }, inputRef: createRef(), handleReset: undefined, handleValidate: undefined, selectValue: null, });