diff --git a/app/components/CodeEditor/CodeEditor.tsx b/app/components/CodeEditor/CodeEditor.tsx
index 32870c3..3e47e99 100644
--- a/app/components/CodeEditor/CodeEditor.tsx
+++ b/app/components/CodeEditor/CodeEditor.tsx
@@ -97,12 +97,14 @@ const useCodePersistence = (
// EditorControls component for the buttons section
const EditorControls = ({
handleValidate,
+ handleBeautify,
isValidating,
resetCode,
nextStepPath,
outputResult,
}: {
handleValidate: () => void;
+ handleBeautify: () => void;
isValidating: boolean;
resetCode: () => void;
nextStepPath: string | undefined;
@@ -126,6 +128,10 @@ const EditorControls = ({
Reset
+
+
+ Beautify
+
{!nextStepPath ? (
@@ -208,6 +214,8 @@ export default function CodeEditor({
dispatchOutput({ type: "RESET" });
};
+ const handleBeautify = () => tryFormattingCode(editorRef, setCodeString);
+
const handleEditorMount = (editor: any, monaco: Monaco) => {
setMonaco(monaco);
@@ -237,6 +245,7 @@ export default function CodeEditor({
void;
isDisabled?: boolean;
tooltip?: string;
diff --git a/app/styles/theme.ts b/app/styles/theme.ts
index 4ab7f90..ec1f365 100644
--- a/app/styles/theme.ts
+++ b/app/styles/theme.ts
@@ -15,6 +15,19 @@ const Button = {
bg: "hsl(var(--primary) / 0.6)",
},
},
+ secondary: {
+ color: "hsl(var(--text))",
+ bg: "hsl(var(--background2))",
+ borderColor: "hsl(var(--border-color))",
+ borderWidth: "1px",
+ _hover: {
+ bg: "hsl(var(--primary) / 0.12)",
+ borderColor: "hsl(var(--primary))",
+ },
+ _active: {
+ bg: "hsl(var(--primary) / 0.2)",
+ },
+ },
success: {
color: "hsl(var(--success))",
borderColor: "hsl(var(--success))",