From 5999604df49232ba867f408734caf17b0ab48b40 Mon Sep 17 00:00:00 2001 From: DDMeaqua Date: Sat, 12 Oct 2024 14:39:25 +0800 Subject: [PATCH] chore: wip --- app/components/chat.tsx | 5 +++-- app/components/stt-config.tsx | 42 +++++++++++++++++++++++++++-------- app/constant.ts | 18 +++++++++++++-- app/icons/vioce-close.svg | 1 + app/icons/vioce-open.svg | 1 + app/store/config.ts | 2 ++ 6 files changed, 56 insertions(+), 13 deletions(-) create mode 100644 app/icons/vioce-close.svg create mode 100644 app/icons/vioce-open.svg diff --git a/app/components/chat.tsx b/app/components/chat.tsx index a1584d899..46e4856f1 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -10,7 +10,8 @@ import React, { } from "react"; import SendWhiteIcon from "../icons/send-white.svg"; -import VoiceWhiteIcon from "../icons/voice-white.svg"; +import VoiceOpenIcon from "../icons/vioce-open.svg"; +import VoiceCloseIcon from "../icons/vioce-close.svg"; import BrainIcon from "../icons/brain.svg"; import RenameIcon from "../icons/rename.svg"; import ExportIcon from "../icons/share.svg"; @@ -830,7 +831,7 @@ export function ChatActions(props: { isListening ? await stopListening() : await startListening() } text={isListening ? Locale.Chat.StopSpeak : Locale.Chat.StartSpeak} - icon={} + icon={isListening ? : } /> )} diff --git a/app/components/stt-config.tsx b/app/components/stt-config.tsx index f83d28030..478259041 100644 --- a/app/components/stt-config.tsx +++ b/app/components/stt-config.tsx @@ -2,7 +2,7 @@ import { STTConfig, STTConfigValidator } from "../store"; import Locale from "../locales"; import { ListItem, Select } from "./ui-lib"; -import { DEFAULT_STT_ENGINES } from "../constant"; +import { DEFAULT_STT_ENGINES, DEFAULT_STT_LANGUAGES } from "../constant"; import { isFirefox } from "../utils"; export function STTConfigList(props: { @@ -25,20 +25,44 @@ export function STTConfigList(props: { } > - {!isFirefox() && ( - + + + + {props.sttConfig.engine === "Web Speech API" && !isFirefox() && ( +