Files
buzz/components/error.tsx
T
dmgnr 38fa0bc45b chore: upgrade Next.js 16.2.6 to 16.4.0
Move to the newer stable same-major release for current Next.js fixes and improvements. Update the pinned dependency and lockfile, align Bun and build configuration, and adjust compatibility changes in settings, health, error, donate, and rubgram routes.
2026-10-09 10:42:11 +00:00

31 lines
850 B
TypeScript

"use client";
import type { ErrorInfo } from "next/dist/client/components/error-boundary";
import { ModalBase } from "./modal";
import { Button } from "./ui/button";
import { DialogClose, DialogFooter } from "./ui/dialog";
export function ErrorModal({
error,
reset,
}: Omit<ErrorInfo, "unstable_retry">) {
return (
<ModalBase title="Modal Error">
An error occured while spawning modal:
<pre className="break-all whitespace-pre-wrap">
{error instanceof Error
? error.stack?.split("\n").slice(0, 2).join("\n")
: String(error)}
</pre>
<DialogFooter>
<DialogClose asChild>
<Button variant="outline">Close</Button>
</DialogClose>
<Button variant="destructive" onClick={reset}>
Retry
</Button>
</DialogFooter>
</ModalBase>
);
}