From 55df6b10013dc72bc2f8f46103eb984f0991431b Mon Sep 17 00:00:00 2001
From: Jan Tuomi <jans.tuomi@gmail.com>
Date: Sun, 6 Feb 2022 22:49:23 +0200
Subject: Stuff

---
 src/Editor.tsx | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

(limited to 'src/Editor.tsx')

diff --git a/src/Editor.tsx b/src/Editor.tsx
index afce380..2fff5b9 100644
--- a/src/Editor.tsx
+++ b/src/Editor.tsx
@@ -3,7 +3,7 @@ import "ace-builds/src-noconflict/mode-java"
 import "ace-builds/src-noconflict/theme-github"
 import { useState } from "react"
 import styles from "./Editor.module.css"
-import { APIResult, submitSource, useExamples } from "./api"
+import { SubmitResult, submitSource, useExamples } from "./api"
 import Select from "react-select"
 
 const defaultSourceText = `define times2
@@ -17,7 +17,7 @@ const defaultSourceText = `define times2
 const Editor = () => {
   const examples = useExamples()
   const [sourceText, setSourceText] = useState(defaultSourceText)
-  const [result, setResult] = useState<APIResult<string, Error>>({ type: "not_yet_requested" })
+  const [result, setResult] = useState<SubmitResult>({ type: "not_yet_requested" })
   const onChange = setSourceText
 
   const executeCode = async (text: string) => {
@@ -69,20 +69,24 @@ const Editor = () => {
             Failed to run code on the server. See console for details.
           </div>
         )
-      case "success":
+      case "success": {
+        const text = `Output:\n${result.data}`
         return (
           <AceEditor
             mode=""
             theme="github"
             onChange={() => undefined}
-            value={result.data}
+            value={text}
             name="results"
             editorProps={{ $blockScrolling: true }}
             width="100%"
+            minLines={10}
+            maxLines={10}
             fontSize={16}
             readOnly
           />
         )
+      }
     }
   }
 
-- 
cgit v1.3

