diff --git a/web/src/components/Settings/SettingsDialog.jsx b/web/src/components/Settings/SettingsDialog.jsx index 5ed27c9..b2247cb 100644 --- a/web/src/components/Settings/SettingsDialog.jsx +++ b/web/src/components/Settings/SettingsDialog.jsx @@ -43,6 +43,54 @@ import { import defaultSettings from './defaultSettings' import { a11yProps, TabPanel } from './tabComponents' +const SliderInput = ({ + isProMode, + title, + value, + setValue, + sliderMin, + sliderMax, + inputMin, + inputMax, + step = 1, + onBlurCallback, +}) => { + const onBlur = ({ target: { value } }) => { + if (value < inputMin) return setValue(inputMin) + if (value > inputMax) return setValue(inputMax) + + onBlurCallback && onBlurCallback(value) + } + + const onInputChange = ({ target: { value } }) => setValue(value === '' ? '' : Number(value)) + const onSliderChange = (_, newValue) => setValue(newValue) + + return ( + <> +