import type { TTSConfig } from '../store';
import {
DEFAULT_TTS_ENGINE,
DEFAULT_TTS_ENGINES,
DEFAULT_TTS_MODELS,
DEFAULT_TTS_VOICES,
} from '../constant';
import Locale from '../locales';
import { TTSConfigValidator } from '../store';
import { InputRange } from './input-range';
import { ListItem, Select } from './ui-lib';
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,
)),
);
}}
>
>
)}
>
);
}