Skip to content

Commit 50c4e8a

Browse files
[fixed 🐱‍🏍] fixed linting build issues 🥙
1 parent d77961b commit 50c4e8a

4 files changed

Lines changed: 8 additions & 24 deletions

File tree

websites/src/app/_actions/execute.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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 {

websites/src/app/_components/code-editor.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use client";
22

33
import { Editor } from "@monaco-editor/react";
4-
import { useTheme } from "next-themes";
54
import { Card, CardContent } from "@/components/ui/card";
65
import { Badge } from "@/components/ui/badge";
76
import { 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
};

websites/src/app/_components/output-viewer.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use client";
22

33
import { Editor } from "@monaco-editor/react";
4-
import { useTheme } from "next-themes";
54
import { Card, CardContent } from "@/components/ui/card";
65
import { Button } from "@/components/ui/button";
76
import { Badge } from "@/components/ui/badge";
@@ -18,26 +17,16 @@ interface OutputViewerProps {
1817

1918
export 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 = () => {

websites/src/app/page.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { CodeEditor } from "./_components/code-editor";
2323
import { OutputViewer } from "./_components/output-viewer";
2424
import { executeCodeAction } from "./_actions/execute";
2525
import { ExecutionResult, Language } from "@/@types";
26+
import Image from "next/image";
2627

2728
export 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>

0 commit comments

Comments
 (0)