From c30398a453675bdb093c448169b115ecda44b2d3 Mon Sep 17 00:00:00 2001 From: ngc2207 Date: Sun, 5 Jan 2025 08:38:37 +0800 Subject: [PATCH] feat(playground): add submit button to the editor interface with icon --- src/app/playground/page.tsx | 113 ++++++++++++++++++++---------------- 1 file changed, 64 insertions(+), 49 deletions(-) diff --git a/src/app/playground/page.tsx b/src/app/playground/page.tsx index 05c964e..f29447c 100644 --- a/src/app/playground/page.tsx +++ b/src/app/playground/page.tsx @@ -1,6 +1,8 @@ "use client"; +import { Send } from "lucide-react"; import * as monaco from "monaco-editor"; +import { Button } from "@/components/ui/button"; import { useEffect, useRef, useState } from "react"; import { Editor, loader } from "@monaco-editor/react"; import { MonacoLanguageClient } from "monaco-languageclient"; @@ -78,7 +80,7 @@ export default function PlaygroundPage() { webSocketRef.current.close(); webSocketRef.current = null; } - if(language in LSP_SUPPORTED_LANGUAGES){ + if (language in LSP_SUPPORTED_LANGUAGES) { try { const languageClient = await connectToLanguageServer( language, @@ -98,54 +100,67 @@ export default function PlaygroundPage() { return (
- - - - setLanguage("c")} - disabled={language === "c"} - > - - setLanguage("cpp")} - disabled={language === "cpp"} - > - - setLanguage("java")} - disabled={language === "java"} - > - - - - - +
+ + + + setLanguage("c")} + disabled={language === "c"} + > + + setLanguage("cpp")} + disabled={language === "cpp"} + > + + setLanguage("java")} + disabled={language === "java"} + > + + + + + +
+ +
+