Files
yaak/apps/yaak-client/components/RouteError.tsx
Gregory Schier ee69db0f12 Align lint fixes with main and resolve merge conflicts
- Convert biome-ignore to oxlint-disable-next-line across client app
- Fix no-base-to-string with type narrowing instead of suppressions
- Fix no-floating-promises with fireAndForget() in proxy app
- Fix restrict-template-expressions with String() wrapping
- Resolve leftover merge conflict markers in manager.rs
- Remove duplicate cmd_plugin_init_errors from lib.rs
- Add graphql as explicit dependency in yaak-client

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 13:02:29 -07:00

44 lines
1.4 KiB
TypeScript

import { Button, FormattedError, Heading, VStack } from "@yaakapp-internal/ui";
import { DetailsBanner } from "./core/DetailsBanner";
export default function RouteError({ error }: { error: unknown }) {
console.log("Error", error);
const stringified = JSON.stringify(error);
// oxlint-disable-next-line no-explicit-any -- none
const message = (error as any).message ?? stringified;
const stack =
typeof error === "object" && error != null && "stack" in error ? String(error.stack) : null;
return (
<div className="flex items-center justify-center h-full">
<VStack space={5} className="w-[50rem] !h-auto">
<Heading>Route Error 🔥</Heading>
<FormattedError>
{message}
{stack && (
<DetailsBanner
color="secondary"
className="mt-3 select-auto text-xs max-h-[40vh]"
summary="Stack Trace"
>
<div className="mt-2 text-xs">{stack}</div>
</DetailsBanner>
)}
</FormattedError>
<VStack space={2}>
<Button
color="primary"
onClick={async () => {
window.location.assign("/");
}}
>
Go Home
</Button>
<Button color="info" onClick={() => window.location.reload()}>
Refresh
</Button>
</VStack>
</VStack>
</div>
);
}