import { TTSConfig, TTSConfigValidator } from "../store"; import Locale from "../locales"; import { ListItem, Select } from "./ui-lib"; import { DEFAULT_TTS_ENGINE, DEFAULT_TTS_ENGINES, DEFAULT_TTS_MODELS, DEFAULT_TTS_VOICES, } from "../constant"; import { InputRange } from "./input-range"; export function TTSConfigList(props: { ttsConfig: TTSConfig; updateConfig: (updater: (config: TTSConfig) => void) => void; }) { return ( <> props.updateConfig( (config) => (config.enable = e.currentTarget.checked), ) } > {/* props.updateConfig( (config) => (config.autoplay = e.currentTarget.checked), ) } > */} {props.ttsConfig.engine === DEFAULT_TTS_ENGINE && ( <> { props.updateConfig( (config) => (config.speed = TTSConfigValidator.speed( e.currentTarget.valueAsNumber, )), ); }} > )} ); }