Workflow-App/Workflow/app/global-error.tsx

89 lines
2.3 KiB
TypeScript
Raw Permalink Normal View History

"use client";
import { useEffect } from "react";
export default function GlobalError({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
useEffect(() => {
console.error("Uncaught root error:", error);
}, [error]);
return (
<html lang="en">
<body
style={{
margin: 0,
background: "#f6f5f2",
color: "#20201e",
fontFamily:
"Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif",
}}
>
<main
style={{
minHeight: "100vh",
display: "grid",
placeItems: "center",
padding: "24px",
boxSizing: "border-box",
}}
>
<section
style={{
width: "min(100%, 560px)",
padding: "40px",
border: "1px solid #d8d5cf",
borderRadius: "12px",
background: "#fcfbf8",
boxSizing: "border-box",
}}
>
<p
style={{
margin: "0 0 12px",
color: "#6d6a64",
fontSize: "12px",
fontWeight: 700,
letterSpacing: "0.08em",
textTransform: "uppercase",
}}
>
Something went wrong
</p>
<h1 style={{ margin: "0 0 12px", fontSize: "28px", lineHeight: 1.2 }}>
Workflow could not start
</h1>
<p style={{ margin: "0 0 24px", color: "#6d6a64", lineHeight: 1.6 }}>
The application hit an unrecoverable error. Try loading it again.
If the problem continues, check the server console for the error
details.
</p>
<button
type="button"
onClick={reset}
style={{
border: 0,
borderRadius: "8px",
background: "#29483c",
color: "#faf9f6",
cursor: "pointer",
font: "inherit",
fontSize: "14px",
fontWeight: 700,
padding: "12px 18px",
}}
>
Try again
</button>
</section>
</main>
</body>
</html>
);
}