update STT/TTS option dropdowns

This commit is contained in:
timothycarambat 2024-05-14 14:17:19 -07:00
parent e9e4ffb838
commit 275be6a0f3
3 changed files with 9 additions and 11 deletions

View File

@ -84,6 +84,7 @@ function ElevenLabsModelSelection({ apiKey, settings }) {
<select <select
name="TTSElevenLabsVoiceModel" name="TTSElevenLabsVoiceModel"
required={true} required={true}
defaultValue={settings?.TTSElevenLabsVoiceModel}
className="bg-zinc-900 border-gray-500 text-white text-sm rounded-lg block w-full p-2.5" className="bg-zinc-900 border-gray-500 text-white text-sm rounded-lg block w-full p-2.5"
> >
{Object.keys(groupedModels) {Object.keys(groupedModels)
@ -91,11 +92,7 @@ function ElevenLabsModelSelection({ apiKey, settings }) {
.map((organization) => ( .map((organization) => (
<optgroup key={organization} label={organization}> <optgroup key={organization} label={organization}>
{groupedModels[organization].map((model) => ( {groupedModels[organization].map((model) => (
<option <option key={model.id} value={model.id}>
key={model.id}
value={model.id}
selected={settings?.OpenAiModelPref === model.id}
>
{model.name} {model.name}
</option> </option>
))} ))}

View File

@ -35,7 +35,11 @@ export default function OpenAiTextToSpeechOptions({ settings }) {
> >
{["alloy", "echo", "fable", "onyx", "nova", "shimmer"].map( {["alloy", "echo", "fable", "onyx", "nova", "shimmer"].map(
(voice) => { (voice) => {
return <option value={voice}>{toProperCase(voice)}</option>; return (
<option key={voice} value={voice}>
{toProperCase(voice)}
</option>
);
} }
)} )}
</select> </select>

View File

@ -47,7 +47,7 @@ export default function TextToSpeechProvider({ settings }) {
const searchInputRef = useRef(null); const searchInputRef = useRef(null);
const handleSubmit = async (e) => { const handleSubmit = async (e) => {
e.preventDefault(); e?.preventDefault();
const form = e.target; const form = e.target;
const data = { TextToSpeechProvider: selectedProvider }; const data = { TextToSpeechProvider: selectedProvider };
const formData = new FormData(form); const formData = new FormData(form);
@ -110,10 +110,7 @@ export default function TextToSpeechProvider({ settings }) {
</div> </div>
<div className="w-full justify-end flex"> <div className="w-full justify-end flex">
{hasChanges && ( {hasChanges && (
<CTAButton <CTAButton className="mt-3 mr-0 -mb-14 z-10">
onClick={() => handleSubmit()}
className="mt-3 mr-0 -mb-14 z-10"
>
{saving ? "Saving..." : "Save changes"} {saving ? "Saving..." : "Save changes"}
</CTAButton> </CTAButton>
)} )}