diff --git a/src/ErrorFallback.tsx b/src/ErrorFallback.tsx
index 560fcd6..3cb1b57 100644
--- a/src/ErrorFallback.tsx
+++ b/src/ErrorFallback.tsx
@@ -1,113 +1,110 @@
-import { useState } from "react";
-import { Alert, AlertTitle, AlertDescription } from "./components/ui/alert";
-import { Button } from "./components/ui/button";
-import { AIErrorHelper } from "./components/AIErrorHelper";
-import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/ui/collapsible";
-
-import { AlertTriangleIcon, RefreshCwIcon, ChevronDownIcon, ChevronUpIcon, CopyIcon, CheckIcon } from "lucide-react";
-
- if (import.meta.env.DEV) throw error;
- const [isStackOpen, setIsStackOpen] =
-
- const errorDetails = `Error: ${error.message}\n\nSta
- setCopied(true);
-
- return (
-
- navigator.clipboard.writeText(errorDetails);
- setCopied(true);
- setTimeout(() => setCopied(false), 2000);
- };
-
- return (
-
-
-
-
- This spark has encountered a runtime error
-
- Something unexpected happened while running the application. The error details are shown below. Contact the spark author and let them know about this issue.
-
-
-
- {copied ? (
-
- >
- <>
- Copy All
- )}
-
- {error.message}
-
-
-
-
-
-
- )}
-
-
- );
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+import { useState } from "react";
+import { Alert, AlertTitle, AlertDescription } from "./components/ui/alert";
+import { Button } from "./components/ui/button";
+import { AIErrorHelper } from "./components/AIErrorHelper";
+import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/ui/collapsible";
+import { AlertTriangleIcon, RefreshCwIcon, ChevronDownIcon, ChevronUpIcon, CopyIcon, CheckIcon } from "lucide-react";
+
+interface ErrorFallbackProps {
+ error: Error;
+ resetErrorBoundary: () => void;
+}
+
+export function ErrorFallback({ error, resetErrorBoundary }: ErrorFallbackProps) {
+ if (import.meta.env.DEV) throw error;
+
+ const [isStackOpen, setIsStackOpen] = useState(false);
+ const [copied, setCopied] = useState(false);
+
+ const errorDetails = `Error: ${error.message}\n\nStack Trace:\n${error.stack || 'No stack trace available'}`;
+
+ const handleCopy = () => {
+ navigator.clipboard.writeText(errorDetails);
+ setCopied(true);
+ setTimeout(() => setCopied(false), 2000);
+ };
+
+ return (
+
+
+
+
+ This spark has encountered a runtime error
+
+ Something unexpected happened while running the application. The error details are shown below. Contact the spark author and let them know about this issue.
+
+
+
+
+
+
Error Message
+
+ {copied ? (
+ <>
+
+ Copied
+ >
+ ) : (
+ <>
+
+ Copy All
+ >
+ )}
+
+
+
+
+ {error.message}
+
+
+
+
+
+ {isStackOpen ? (
+ <>
+
+ Hide Stack Trace
+ >
+ ) : (
+ <>
+
+ Show Stack Trace
+ >
+ )}
+
+
+
+
+
+ {error.stack || 'No stack trace available'}
+
+
+
+
+
+
+
+
+
+ );
+}