From 5535706a2634f838310a06929f46e9c29d650f80 Mon Sep 17 00:00:00 2001 From: ecwu Date: Sat, 21 Dec 2024 14:10:12 +0800 Subject: [PATCH] Refactor Settings component to replace native select elements with custom Select components for improved UI consistency and usability --- src/components/Settings.tsx | 128 ++++++++++++++++++++---------------- 1 file changed, 73 insertions(+), 55 deletions(-) diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index 9ca3510..a71d8b2 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -49,11 +49,14 @@ import { CardTitle, } from "@/components/ui/card"; import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "@/components/ui/tooltip"; + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectLabel, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; import { Dialog, DialogContent, @@ -152,11 +155,9 @@ const SelectModel = (props: { }} /> ) : ( - + + + + + + Models + {Object.keys(models).map((opt) => ( + + {opt} + + ))} + + + )} ); @@ -679,22 +688,21 @@ export default (props: {
- +
@@ -1055,22 +1063,27 @@ export default (props: { - + + + + + + Voices + {TTS_VOICES.map((opt) => ( + + {opt} + + ))} + + +
- + + + + + + Formats + {TTS_FORMAT.map((opt) => ( + + {opt} + + ))} + + +