1- import "@fortawesome/fontawesome-free/css/all.css" ;
2- import { Editor } from "@monaco-editor/react" ;
3- import { Avatar , Button , CircularProgress , styled , FormControlLabel , Switch , Typography , Slider } from "@mui/material" ;
4- import Box from "@mui/material/Box" ;
5- import { useSnackbar } from "notistack" ;
61import React , { useCallback , useEffect , useRef , useState } from "react" ;
2+ import { useSnackbar } from "notistack" ;
3+ import {
4+ Avatar ,
5+ Button ,
6+ CircularProgress ,
7+ FormControlLabel ,
8+ Slider ,
9+ styled ,
10+ Switch ,
11+ Typography ,
12+ } from "@mui/material" ;
13+ import Box from "@mui/material/Box" ;
14+ import { Editor } from "@monaco-editor/react" ;
715import { FaPlay , FaFileUpload , FaFileDownload , FaCopy , FaTrash } from "react-icons/fa" ;
8- // import { FaFileUpload } from "react-icons/fa";
16+ import "@fortawesome/fontawesome-free/css/all.css" ;
17+
18+ // Local imports after external imports
919import GithubSignIn from "../components/GithubSignIn" ;
1020import GoogleSignIn from "../components/GoogleSignIn" ;
1121import "../components/css/EditorComponent.css" ;
@@ -23,7 +33,6 @@ import {
2333} from "../constants/constants" ;
2434import { useAuth } from "../context/AuthContext" ;
2535import Footer from "../components/Footer" ;
26- // import FileUploadIcon from "@mui/icons-material/FileUpload";
2736
2837const StyledButton = styled ( Button ) ( {
2938 display : "flex" ,
@@ -412,11 +421,11 @@ function EditorComponent() {
412421 value = { code }
413422 onChange = { setCode }
414423 language = { languageDetails . DEFAULT_LANGUAGE }
415- options = { {
424+ options = { {
416425 minimap : { enabled : false } ,
417426 lineNumbers : showLineNumbers ? "on" : "off" ,
418427 wordWrap : wordWrap ? "on" : "off" ,
419- fontSize : fontSize
428+ fontSize : fontSize ,
420429 } }
421430 />
422431 < div
@@ -558,32 +567,35 @@ function EditorComponent() {
558567 < Typography variant = "subtitle2" className = "editor-settings-title" >
559568 Editor Settings
560569 </ Typography >
561-
570+
562571 < FormControlLabel
563572 control = {
564- < Switch
565- checked = { showLineNumbers }
573+ < Switch
574+ checked = { showLineNumbers }
566575 onChange = { handleLineNumbersToggle }
567576 size = "small"
568577 />
569578 }
570579 label = "Line Numbers"
571580 className = "editor-settings-control"
572581 />
573-
582+
574583 < FormControlLabel
575584 control = {
576- < Switch
577- checked = { wordWrap }
585+ < Switch
586+ checked = { wordWrap }
578587 onChange = { handleWordWrapToggle }
579588 size = "small"
580589 />
581590 }
582591 label = "Word Wrap"
583592 className = "editor-settings-control"
584593 />
585-
586- < Typography variant = "body2" sx = { { margin : "0.5rem 0 0.25rem 0" } } >
594+
595+ < Typography
596+ variant = "body2"
597+ sx = { { margin : "0.5rem 0 0.25rem 0" } }
598+ >
587599 Font Size: { fontSize } px
588600 </ Typography >
589601 < div className = "editor-settings-slider" >
@@ -598,7 +610,7 @@ function EditorComponent() {
598610 { value : 14 , label : "14" } ,
599611 { value : 16 , label : "16" } ,
600612 { value : 18 , label : "18" } ,
601- { value : 20 , label : "20" }
613+ { value : 20 , label : "20" } ,
602614 ] }
603615 size = "small"
604616 />
@@ -634,22 +646,25 @@ function EditorComponent() {
634646 </ StyledLayout >
635647 < OutputLayout >
636648 < div className = "output-header" >
637- < Typography variant = "h6" sx = { { fontSize : "1rem" , fontWeight : "bold" } } >
649+ < Typography
650+ variant = "h6"
651+ sx = { { fontSize : "1rem" , fontWeight : "bold" } }
652+ >
638653 Output
639654 </ Typography >
640655 < div className = "output-controls" >
641- < Button
642- size = "small"
643- onClick = { copyOutput }
656+ < Button
657+ size = "small"
658+ onClick = { copyOutput }
644659 startIcon = { < FaCopy /> }
645660 variant = "outlined"
646661 sx = { { minWidth : "auto" , padding : "4px 8px" } }
647662 >
648663 Copy
649664 </ Button >
650- < Button
651- size = "small"
652- onClick = { clearOutput }
665+ < Button
666+ size = "small"
667+ onClick = { clearOutput }
653668 startIcon = { < FaTrash /> }
654669 variant = "outlined"
655670 sx = { { minWidth : "auto" , padding : "4px 8px" , marginLeft : "0.5rem" } }
@@ -661,10 +676,14 @@ function EditorComponent() {
661676 < div className = "output-content" >
662677 { Array . isArray ( output ) && output . length > 0 ? (
663678 output . map ( ( result , i ) => (
664- < div key = { i } className = "output-line" > { result } </ div >
679+ < div key = { i } className = "output-line" >
680+ { result }
681+ </ div >
665682 ) )
666683 ) : (
667- < div className = "output-empty" > No output yet. Run your code to see results!</ div >
684+ < div className = "output-empty" >
685+ No output yet. Run your code to see results!
686+ </ div >
668687 ) }
669688 </ div >
670689 </ OutputLayout >
0 commit comments