diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index a4387b0..e9d0653 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -859,8 +859,8 @@ export default (props: {}) => { label="Chat API" endpoint={ctx.chatStore.apiEndpoint} APIkey={ctx.chatStore.apiKey} - tmps={ctx.templateAPIs} - setTmps={ctx.setTemplateAPIs} + temps={ctx.templateAPIs} + setTemps={ctx.setTemplateAPIs} /> @@ -964,8 +964,8 @@ export default (props: {}) => { label="Whisper API" endpoint={ctx.chatStore.whisper_api} APIkey={ctx.chatStore.whisper_key} - tmps={ctx.templateAPIsWhisper} - setTmps={ctx.setTemplateAPIsWhisper} + temps={ctx.templateAPIsWhisper} + setTemps={ctx.setTemplateAPIsWhisper} /> @@ -997,8 +997,8 @@ export default (props: {}) => { label="TTS API" endpoint={ctx.chatStore.tts_api} APIkey={ctx.chatStore.tts_key} - tmps={ctx.templateAPIsTTS} - setTmps={ctx.setTemplateAPIsTTS} + temps={ctx.templateAPIsTTS} + setTemps={ctx.setTemplateAPIsTTS} /> @@ -1122,8 +1122,8 @@ export default (props: {}) => { label="Image Gen API" endpoint={ctx.chatStore.image_gen_api} APIkey={ctx.chatStore.image_gen_key} - tmps={ctx.templateAPIsImageGen} - setTmps={ctx.setTemplateAPIsImageGen} + temps={ctx.templateAPIsImageGen} + setTemps={ctx.setTemplateAPIsImageGen} /> diff --git a/src/pages/Chatbox.tsx b/src/pages/Chatbox.tsx index 79e5a77..1e45148 100644 --- a/src/pages/Chatbox.tsx +++ b/src/pages/Chatbox.tsx @@ -447,7 +447,7 @@ export default function ChatBOX() { keyField="image_gen_key" /> )} - {ctx.templateTools.length > 0 && } + {ctx.templateTools.length > 0 && } diff --git a/src/setAPIsTemplate.tsx b/src/setAPIsTemplate.tsx index 0bb2936..e120eb2 100644 --- a/src/setAPIsTemplate.tsx +++ b/src/setAPIsTemplate.tsx @@ -1,10 +1,24 @@ import { TemplateAPI } from "@/types/chatstore"; import { Tr } from "@/translate"; + +import { + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog"; import { Button } from "./components/ui/button"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { SaveIcon } from "lucide-react"; interface Props { - tmps: TemplateAPI[]; - setTmps: (tmps: TemplateAPI[]) => void; + temps: TemplateAPI[]; + setTemps: (temps: TemplateAPI[]) => void; label: string; endpoint: string; APIkey: string; @@ -12,31 +26,66 @@ interface Props { export function SetAPIsTemplate({ endpoint, APIkey, - tmps, - setTmps, + temps: temps, + setTemps: setTemps, label, }: Props) { return ( - + + + + + + + Save {label} as Template + + Once saved, you can easily access your templates from the dropdown + menu. + + +
+
+ + + +
+
+ + + + + +
+
); }