From 910c85b1c0f95df177ab8c8d60a8dfcde5fa7624 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 21 May 2024 13:06:17 -0500 Subject: [PATCH] Clean up config editor (#11474) * clean up config editor * remove unneeded size --- web/src/pages/ConfigEditor.tsx | 76 ++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/web/src/pages/ConfigEditor.tsx b/web/src/pages/ConfigEditor.tsx index d09c5ad68..ea89d32fb 100644 --- a/web/src/pages/ConfigEditor.tsx +++ b/web/src/pages/ConfigEditor.tsx @@ -11,6 +11,8 @@ import copy from "copy-to-clipboard"; import { useTheme } from "@/context/theme-provider"; import { Toaster } from "@/components/ui/sonner"; import { toast } from "sonner"; +import { LuCopy, LuSave } from "react-icons/lu"; +import { MdOutlineRestartAlt } from "react-icons/md"; type SaveOptions = "saveonly" | "restart"; @@ -69,6 +71,7 @@ function ConfigEditor() { } copy(editorRef.current.getValue()); + toast.success("Config copied to clipboard.", { position: "top-center" }); }, [editorRef]); useEffect(() => { @@ -117,7 +120,6 @@ function ConfigEditor() { return () => { configRef.current = null; - editorRef.current = null; modelRef.current = null; }; }); @@ -127,37 +129,51 @@ function ConfigEditor() { } return ( -
-
- Config -
- - - +
+
+
+ + Config Editor + +
+ + + +
+ + {error && ( +
+ {error} +
+ )} + +
- - {error && ( -
- {error} -
- )} - -
);