diff --git a/src/frontend/src/customization/components/custom-api-generator.tsx b/src/frontend/src/customization/components/custom-api-generator.tsx new file mode 100644 index 000000000000..d6d6bb6971bf --- /dev/null +++ b/src/frontend/src/customization/components/custom-api-generator.tsx @@ -0,0 +1,3 @@ +export function CustomAPIGenerator() { + return <>; +} diff --git a/src/frontend/src/customization/hooks/use-custom-api-code.ts b/src/frontend/src/customization/hooks/use-custom-api-code.ts new file mode 100644 index 000000000000..034f8f6f0335 --- /dev/null +++ b/src/frontend/src/customization/hooks/use-custom-api-code.ts @@ -0,0 +1,19 @@ +import { + getCurlRunCode, + getCurlWebhookCode, +} from "@/modals/apiModal/utils/get-curl-code"; +import getJsApiCode from "@/modals/apiModal/utils/get-js-api-code"; +import getPythonApiCode from "@/modals/apiModal/utils/get-python-api-code"; +import getPythonCode from "@/modals/apiModal/utils/get-python-code"; +import getWidgetCode from "@/modals/apiModal/utils/get-widget-code"; + +export function useCustomAPICode() { + return { + getCurlRunCode, + getCurlWebhookCode, + getJsApiCode, + getPythonApiCode, + getPythonCode, + getWidgetCode, + }; +} diff --git a/src/frontend/src/modals/IOModal/components/chatView/chatInput/components/buttonSendWrapper/index.tsx b/src/frontend/src/modals/IOModal/components/chatView/chatInput/components/buttonSendWrapper/index.tsx index 81f42675c2a5..4c148575cddc 100644 --- a/src/frontend/src/modals/IOModal/components/chatView/chatInput/components/buttonSendWrapper/index.tsx +++ b/src/frontend/src/modals/IOModal/components/chatView/chatInput/components/buttonSendWrapper/index.tsx @@ -8,7 +8,6 @@ type ButtonSendWrapperProps = { send: () => void; lockChat: boolean; noInput: boolean; - saveLoading: boolean; chatValue: string; files: FilePreviewType[]; }; @@ -17,7 +16,6 @@ const ButtonSendWrapper = ({ send, lockChat, noInput, - saveLoading, chatValue, files, }: ButtonSendWrapperProps) => { @@ -31,15 +29,11 @@ const ButtonSendWrapper = ({ ? "text-primary" : "bg-chat-send text-background", )} - disabled={lockChat || saveLoading} + disabled={lockChat} onClick={(): void => send()} unstyled > - file.loading) - } - > + file.loading)}> file.loading)) && - !noInput + !(lockChat || files.some((file) => file.loading)) && !noInput } > 0 @@ -45,10 +43,10 @@ const TextAreaWrapper = ({ const additionalClassNames = "form-modal-lockchat pl-14"; useEffect(() => { - if (!lockChat && !noInput && !saveLoading) { + if (!lockChat && !noInput) { inputRef.current?.focus(); } - }, [lockChat, noInput, saveLoading]); + }, [lockChat, noInput]); return (