From 37238ca2ca4284db6b41d3077a27ce9aa055fccf Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Tue, 4 Jun 2024 18:52:10 -0300 Subject: [PATCH] Fixed secret key modal, made it congruent with existing design --- .../src/modals/secretKeyModal/index.tsx | 170 +++++++----------- src/frontend/src/types/components/index.ts | 6 +- 2 files changed, 70 insertions(+), 106 deletions(-) diff --git a/src/frontend/src/modals/secretKeyModal/index.tsx b/src/frontend/src/modals/secretKeyModal/index.tsx index 879280dd5..f700501d1 100644 --- a/src/frontend/src/modals/secretKeyModal/index.tsx +++ b/src/frontend/src/modals/secretKeyModal/index.tsx @@ -11,15 +11,10 @@ import { nodeIconsLucide } from "../../utils/styleUtils"; import BaseModal from "../baseModal"; export default function SecretKeyModal({ - title, - cancelText, - confirmationText, children, - icon, data, onCloseModal, }: ApiKeyType) { - const Icon: any = nodeIconsLucide[icon]; const [open, setOpen] = useState(false); const [apiKeyName, setApiKeyName] = useState(data?.apikeyname ?? ""); const [apiKeyValue, setApiKeyValue] = useState(""); @@ -66,118 +61,91 @@ export default function SecretKeyModal({ .catch((err) => {}); } + function handleSubmitForm() { + if (!renderKey) { + setRenderKey(true); + handleAddNewKey(); + } else { + setOpen(false); + } + } + return ( - + {children} - - {title} - - - {renderKey === true && ( - <> - + + {" "} Please save this secret key somewhere safe and accessible. For security reasons,{" "} you won't be able to view it again through your account. If you lose this secret key, you'll need to generate a new one. - -
+ + ) : ( + <>Create a secret API Key to use Langflow API. + ) + } + > + Create API Key +