File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,9 +25,10 @@ export async function executeCodeAction(input: Input): Promise<Output> {
2525 output : response . data . output ,
2626 responseTime : Math . round ( responseTime ) ,
2727 } ;
28+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2829 } catch ( error : any ) {
2930 return {
30- output : error . response . data . details ,
31+ output : error ? .response ? .data . details ,
3132 responseTime : Math . round ( responseTime ) ,
3233 } ;
3334 } finally {
Original file line number Diff line number Diff line change 11"use client" ;
22
33import { Editor } from "@monaco-editor/react" ;
4- import { useTheme } from "next-themes" ;
54import { Card , CardContent } from "@/components/ui/card" ;
65import { Badge } from "@/components/ui/badge" ;
76import { Loader2 } from "lucide-react" ;
@@ -23,8 +22,6 @@ export function CodeEditor({
2322 height = "300px" ,
2423 readOnly = false ,
2524} : CodeEditorProps ) {
26- const { theme } = useTheme ( ) ; // You can still use this for overall app theme logic if needed elsewhere
27-
2825 const handleEditorChange = ( newValue : string | undefined ) => {
2926 onChange ( newValue || "" ) ;
3027 } ;
Original file line number Diff line number Diff line change 11"use client" ;
22
33import { Editor } from "@monaco-editor/react" ;
4- import { useTheme } from "next-themes" ;
54import { Card , CardContent } from "@/components/ui/card" ;
65import { Button } from "@/components/ui/button" ;
76import { Badge } from "@/components/ui/badge" ;
@@ -18,26 +17,16 @@ interface OutputViewerProps {
1817
1918export function OutputViewer ( {
2019 output,
21- language, // Although output is plaintext, keeping language prop for consistency and future expansion
2220 executionTime,
2321 status,
2422} : OutputViewerProps ) {
25- const { theme } = useTheme ( ) ; // Keep for consistency, though we're overriding here
26-
2723 const copyOutput = ( ) => {
28- // Using document.execCommand for broader iframe compatibility
29- const textarea = document . createElement ( "textarea" ) ;
30- textarea . value = output ;
31- document . body . appendChild ( textarea ) ;
32- textarea . select ( ) ;
3324 try {
34- document . execCommand ( "copy" ) ;
35- // You can add a visual feedback like a temporary "Copied!" message
25+ navigator . clipboard . writeText ( output ) ;
3626 console . log ( "Output copied to clipboard!" ) ;
3727 } catch ( err ) {
3828 console . error ( "Failed to copy text:" , err ) ;
3929 }
40- document . body . removeChild ( textarea ) ;
4130 } ;
4231
4332 const downloadOutput = ( ) => {
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import { CodeEditor } from "./_components/code-editor";
2323import { OutputViewer } from "./_components/output-viewer" ;
2424import { executeCodeAction } from "./_actions/execute" ;
2525import { ExecutionResult , Language } from "@/@types" ;
26+ import Image from "next/image" ;
2627
2728export default function ExecuteMePlatform ( ) {
2829 const [ selectedLanguage , setSelectedLanguage ] = useState < Language > ( "python" ) ;
@@ -53,12 +54,7 @@ export default function ExecuteMePlatform() {
5354 language : selectedLanguage ,
5455 } ) ;
5556 } catch ( err ) {
56- setExecutionResult ( {
57- status : "error" ,
58- output : "error is here" ,
59- executionTime : 0 ,
60- language : selectedLanguage ,
61- } ) ;
57+ console . log ( err ) ;
6258 } finally {
6359 setIsExecuting ( false ) ;
6460 }
@@ -236,10 +232,11 @@ export default function ExecuteMePlatform() {
236232 rel = "noopener noreferrer"
237233 className = "inline-flex items-center gap-2 bg-yellow-500 hover:bg-yellow-600 text-gray-900 font-bold py-2 px-4 rounded-full transition-colors duration-200 shadow-md"
238234 >
239- < img
235+ < Image
240236 src = "https://www.buymeacoffee.com/assets/img/BMC-btn-logo.svg" // Official BMC logo
241237 alt = "Buy Me A Coffee"
242- className = "h-5 w-5"
238+ height = { 20 }
239+ width = { 20 }
243240 />
244241 < span > Buy Me A Coffee</ span >
245242 </ a >
You can’t perform that action at this time.
0 commit comments