Files
formbricks/apps/web/app/error.tsx
T
Anshuman Pandey dd0d296c6a feat: question-date (#1660)
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
2023-12-08 11:22:19 +00:00

26 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>
);
}