import { useState, useCallback, useEffect } from 'react' import { components } from 'react-select' import AsyncSelect from 'react-select/async' import { IVSelectOption } from '.' import CloseIcon from '~/icons/compiled/Close' import TailwindChevronDown from '~/icons/compiled/TailwindChevronDown' export interface AsyncIVSelectProps { id?: string name?: string defaultValue?: IVSelectOption onSearch: (query: string) => Promise onChange?: (value: string) => void onBlur?: () => void defaultOptions?: IVSelectOption[] | boolean defaultLabel?: string noOptionsMessage?: string cacheOptions?: boolean isClearable?: boolean disabled?: boolean } /** * This attempts to normalize the more advanced properties of a react-select * to be more similar to a bare