@@ -3,7 +3,7 @@ import Layout from "@/components/Layout";
33import EditorComponent from "@/components/Editor" ;
44import ResultWindow from "@/components/ResultWindow" ;
55import { languageExamples , LanguageType } from "@/constants/languageExamples" ;
6- import prettier from "prettier " ;
6+ import { DocumentTextIcon , PlayIcon } from "@heroicons/react/24/outline " ;
77
88const languageOptions = [
99 { value : "javascript" , label : "JavaScript" } ,
@@ -48,7 +48,7 @@ const EditorPage: React.FC = () => {
4848
4949 try {
5050 // Handle other languages with Prettier in frontend
51- // const prettier = await import("prettier/standalone");
51+ const prettier = await import ( "prettier/standalone" ) ;
5252 const plugins = [ ] ;
5353
5454 switch ( language ) {
@@ -85,7 +85,7 @@ const EditorPage: React.FC = () => {
8585 return ;
8686 }
8787
88- const formattedCode = await prettier . format ( code , {
88+ const formattedCode = await prettier . default . format ( code , {
8989 parser : language === "typescript" ? "typescript" : "babel" ,
9090 plugins,
9191 printWidth : 80 ,
@@ -172,15 +172,18 @@ const EditorPage: React.FC = () => {
172172
173173 < button
174174 onClick = { handleRun }
175- className = "absolute top-2 right-4 bg-blue-500 text-white font-bold py-2 px-4 rounded shadow hover:bg-blue-600 z-10"
175+ className = "absolute top-4 right-5 bg-blue-600 text-gray-900 font-bold py-2 px-3 rounded shadow hover:bg-blue-700 z-10 flex gap-2 items-center"
176+ title = "Run Code"
176177 >
178+ < PlayIcon className = "h-5 w-5" />
177179 Run
178180 </ button >
179181 < button
180182 onClick = { handleFormat }
181- className = "absolute top-2 right-20 bg-green-500 text-white font-bold py-2 px-2 rounded shadow hover:bg-green-600 z-10"
183+ className = "absolute top-4 right-32 bg-zinc-400 text-gray-700 font-bold p-3 rounded-full shadow hover:bg-zinc-600 z-10"
184+ title = "Format Code"
182185 >
183- Format
186+ < DocumentTextIcon className = "h-5 w-5" />
184187 </ button >
185188 </ div >
186189 < ResultWindow result = { result } onClear = { handleClear } width = "w-1/2" />
0 commit comments