This commit is contained in:
Hk-Gosuto
2024-03-24 11:42:06 +08:00
parent 428bf81801
commit a18cb2c525
12 changed files with 112 additions and 18 deletions

View File

@@ -1,7 +1,8 @@
import { STTConfig } from "../store";
import { STTConfig, STTConfigValidator } from "../store";
import Locale from "../locales";
import { ListItem } from "./ui-lib";
import { ListItem, Select } from "./ui-lib";
import { DEFAULT_STT_ENGINES } from "../constant";
export function STTConfigList(props: {
sttConfig: STTConfig;
@@ -23,6 +24,25 @@ export function STTConfigList(props: {
}
></input>
</ListItem>
<ListItem title={Locale.Settings.STT.Engine.Title}>
<Select
value={props.sttConfig.engine}
onChange={(e) => {
props.updateConfig(
(config) =>
(config.engine = STTConfigValidator.engine(
e.currentTarget.value,
)),
);
}}
>
{DEFAULT_STT_ENGINES.map((v, i) => (
<option value={v} key={i}>
{v}
</option>
))}
</Select>
</ListItem>
</>
);
}