-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4605460
commit e670260
Showing
19 changed files
with
278 additions
and
446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import React from "react"; | ||
import "./global.css"; | ||
import Landing from "./components/Landing"; | ||
|
||
function App() { | ||
return <Landing />; | ||
return ( | ||
<> | ||
<Landing /> | ||
</> | ||
); | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,32 @@ | ||
import React from "react"; | ||
|
||
const OutputWindow = ({ outputDetails }) => { | ||
const getOutput = () => { | ||
let statusId = outputDetails?.status?.id; | ||
const renderOutput = () => { | ||
const statusId = outputDetails?.status?.id; | ||
const decodedCompileOutput = atob(outputDetails?.compile_output); | ||
const decodedStdout = atob(outputDetails?.stdout); | ||
const decodedStderr = atob(outputDetails?.stderr); | ||
|
||
if (statusId === 6) { | ||
// Compilation error | ||
return ( | ||
<pre className="px-2 py-1 font-normal text-xs text-red-500"> | ||
{atob(outputDetails?.compile_output)} | ||
</pre> | ||
); | ||
} else if (statusId === 3) { | ||
// Successful output | ||
return ( | ||
<pre className="px-2 py-1 font-normal text-xs" style={{ color: "#CCC8C3" }}> | ||
{atob(outputDetails.stdout) !== null | ||
? `${atob(outputDetails.stdout)}` | ||
: null} | ||
</pre> | ||
); | ||
} else if (statusId === 5) { | ||
// Time Limit Exceeded | ||
return ( | ||
<pre className="px-2 py-1 font-normal text-xs text-red-500"> | ||
{`Time Limit Exceeded`} | ||
</pre> | ||
); | ||
} else { | ||
// Other cases (e.g., stderr) | ||
return ( | ||
<pre className="px-2 py-1 font-normal text-xs text-red-500"> | ||
{atob(outputDetails?.stderr)} | ||
</pre> | ||
); | ||
switch (statusId) { | ||
case 6: // Compilation error | ||
return <pre className="error-output">{decodedCompileOutput}</pre>; | ||
case 3: // Successful output | ||
return <pre className="success-output">{decodedStdout || null}</pre>; | ||
case 5: // Time Limit Exceeded | ||
return <pre className="error-output">Time Limit Exceeded</pre>; | ||
default: // Other cases (e.g., stderr) | ||
return <pre className="error-output">{decodedStderr}</pre>; | ||
} | ||
}; | ||
|
||
return ( | ||
<> | ||
<h1 className="font-bold text-xl text-white-800 mb-2">Output</h1> | ||
<div className="w-full h-56 bg-gray-800 rounded-md text-gray-200 font-normal text-sm overflow-y-auto"> | ||
{outputDetails ? <>{getOutput()}</> : null} | ||
{outputDetails && renderOutput()} | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default OutputWindow; | ||
export default OutputWindow; |
Oops, something went wrong.