Files
buzz/components/error.tsx
T
dmgnr a31c8fbb54
Build and Push Image / build-backend (push) Successful in 52s
Build and Push Image / build-frontend (push) Successful in 2m8s
Build and Push Image / push (push) Successful in 1m24s
chore: oxc
2026-06-10 01:44:11 +07:00

29 lines
789 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.stack?.split("\n").slice(0, 2).join("\n")}
</pre>
<DialogFooter>
<DialogClose asChild>
<Button variant="outline">Close</Button>
</DialogClose>
<Button variant="destructive" onClick={reset}>
Retry
</Button>
</DialogFooter>
</ModalBase>
);
}