mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-20 03:00:57 -06:00
27 lines
701 B
TypeScript
27 lines
701 B
TypeScript
"use client";
|
|
|
|
// Error components must be Client components
|
|
import { Button } from "@formbricks/ui/Button";
|
|
import { ErrorComponent } from "@formbricks/ui/ErrorComponent";
|
|
|
|
export default function Error({ error, reset }: { error: Error; reset: () => void }) {
|
|
if (process.env.NODE_ENV === "development") {
|
|
console.error(error.message);
|
|
}
|
|
|
|
return (
|
|
<div className="flex h-full w-full flex-col items-center justify-center">
|
|
<ErrorComponent />
|
|
<Button
|
|
variant="secondary"
|
|
onClick={
|
|
// Attempt to recover by trying to re-render the segment
|
|
() => reset()
|
|
}
|
|
className="mt-2">
|
|
Try again
|
|
</Button>
|
|
</div>
|
|
);
|
|
}
|