Skip to content

Commit

Permalink
Merge pull request #673 from bounswe/frontend/feature/593/execution-time
Browse files Browse the repository at this point in the history
[Frontend] Show Execution Time
  • Loading branch information
ozdentarikcan authored Dec 13, 2024
2 parents ec93256 + 7d90246 commit 3c3e112
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions frontend/src/components/CodeSnippet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const languageUserFriendlyName = {

export const CodeSnippet: React.FC<CodeSnippetProps> = ({ code, language }) => {
const executeCode = useExecuteCode();

const handleExecute = (e: React.MouseEvent<HTMLButtonElement>) => {
e.preventDefault();
const execution: CodeExecution = {
Expand Down Expand Up @@ -81,7 +80,7 @@ export const CodeSnippet: React.FC<CodeSnippetProps> = ({ code, language }) => {
</Button>
{executeCode.isSuccess && (
<div className="mt-2 rounded border border-green-300 bg-green-100 p-2">
<h4 className="mb-4 text-sm font-bold">Output:</h4>
<h4 className="mb-4 text-sm font-bold">Output (in {executeCode.data.data.executionTime}s):</h4>
<pre className="bg-green-50 p-1">{executeCode.data.data.output}</pre>
</div>
)}
Expand Down

0 comments on commit 3c3e112

Please sign in to comment.