From 65326ef2c2e5c75b8c7f3f2b97282c28755c8890 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Wed, 5 Jun 2024 16:13:50 -0300 Subject: [PATCH] Removed unused buttons from API Modal --- .../components/codeTabsComponent/index.tsx | 70 ++++--------------- 1 file changed, 14 insertions(+), 56 deletions(-) diff --git a/src/frontend/src/components/codeTabsComponent/index.tsx b/src/frontend/src/components/codeTabsComponent/index.tsx index 0a0b691c8..3b42608d1 100644 --- a/src/frontend/src/components/codeTabsComponent/index.tsx +++ b/src/frontend/src/components/codeTabsComponent/index.tsx @@ -36,7 +36,7 @@ import { convertValuesToNumbers, hasDuplicateKeys, } from "../../utils/reactflowUtils"; -import { classNames } from "../../utils/utils"; +import { classNames, cn } from "../../utils/utils"; import AccordionComponent from "../accordionComponent"; import DictComponent from "../dictComponent"; import IconComponent from "../genericIconComponent"; @@ -45,6 +45,7 @@ import KeypairListComponent from "../keypairListComponent"; import ShadTooltip from "../shadTooltipComponent"; import { Label } from "../ui/label"; import { Switch } from "../ui/switch"; +import { Button } from "../ui/button"; export default function CodeTabsComponent({ flow, @@ -93,28 +94,6 @@ export default function CodeTabsComponent({ return node.data.node.template[templateParam].type; }; - const downloadAsFile = () => { - const fileExtension = tabs[activeTab].language || ".txt"; - const suggestedFileName = `${"generated-code."}${fileExtension}`; - const fileName = window.prompt("Enter the file name.", suggestedFileName); - - if (!fileName) { - // user pressed cancel on prompt - return; - } - - const blob = new Blob([tabs[activeTab].code], { type: "text/plain" }); - const url = URL.createObjectURL(blob); - const link = document.createElement("a"); - link.download = fileName; - link.href = url; - link.style.display = "none"; - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); - URL.revokeObjectURL(url); - }; - return ( )} -
+
{tweaks && ( -
2 - ? "hidden" - : "relative top-[2.5px] flex gap-2" - } - > +
2 ? "hidden" : "flex gap-2"}>
)} - {allowExport && ( - -
- - Export Flow -
-
- )} {Number(activeTab) < 4 && ( <> - - + )}