import type { ComboboxOnChange, ComboboxOption } from '@invoke-ai/ui-library'; import { Combobox, FormControl, FormLabel } from '@invoke-ai/ui-library'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import { InformationalPopover } from 'common/components/InformationalPopover/InformationalPopover'; import { selectHrfMethod, setHrfMethod } from 'features/hrf/store/hrfSlice'; import { isParameterHRFMethod } from 'features/parameters/types/parameterSchemas'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; const options: ComboboxOption[] = [ { label: 'ESRGAN', value: 'ESRGAN' }, { label: 'bilinear', value: 'bilinear' }, ]; const ParamHrfMethodSelect = () => { const dispatch = useAppDispatch(); const { t } = useTranslation(); const hrfMethod = useAppSelector(selectHrfMethod); const onChange = useCallback( (v) => { if (!isParameterHRFMethod(v?.value)) { return; } dispatch(setHrfMethod(v.value)); }, [dispatch] ); const value = useMemo(() => options.find((o) => o.value === hrfMethod), [hrfMethod]); return ( {t('hrf.upscaleMethod')} ); }; export default memo(ParamHrfMethodSelect);