Refactor Settings component and integrate shadcn UI elements for improved user experience

This commit is contained in:
ecwu
2024-12-20 16:06:01 +08:00
parent 7ecdae8f1d
commit bac65994b0
6 changed files with 1095 additions and 843 deletions

View File

@@ -1,5 +1,6 @@
import { TemplateAPI } from "@/types/chatstore";
import { Tr } from "@/translate";
import { Button } from "./components/ui/button";
interface Props {
tmps: TemplateAPI[];
@@ -16,8 +17,10 @@ export function SetAPIsTemplate({
label,
}: Props) {
return (
<button
className="btn btn-primary btn-sm mt-3"
<Button
variant="default"
size="sm"
className="mt-3"
onClick={() => {
const name = prompt(`Give this **${label}** template a name:`);
if (!name) {
@@ -34,6 +37,6 @@ export function SetAPIsTemplate({
}}
>
{Tr(`Save ${label}`)}
</button>
</Button>
);
}