import React, { ReactNode } from 'react' import { useRecoilState } from 'recoil' import { hdSettingsState, settingState } from '../../store/Atoms' import Selector from '../shared/Selector' import NumberInputSetting from './NumberInputSetting' import SettingBlock from './SettingBlock' export enum HDStrategy { ORIGINAL = 'Original', RESIZE = 'Resize', CROP = 'Crop', } export enum LDMSampler { ddim = 'ddim', plms = 'plms', } function HDSettingBlock() { const [hdSettings, setHDSettings] = useRecoilState(hdSettingsState) if (!hdSettings?.enabled) { return <>> } const onStrategyChange = (value: HDStrategy) => { setHDSettings({ hdStrategy: value }) } const onResizeLimitChange = (value: string) => { const val = value.length === 0 ? 0 : parseInt(value, 10) setHDSettings({ hdStrategyResizeLimit: val }) } const onCropTriggerSizeChange = (value: string) => { const val = value.length === 0 ? 0 : parseInt(value, 10) setHDSettings({ hdStrategyCropTrigerSize: val }) } const onCropMarginChange = (value: string) => { const val = value.length === 0 ? 0 : parseInt(value, 10) setHDSettings({ hdStrategyCropMargin: val }) } const renderOriginalOptionDesc = () => { return (