Files
formbricks/apps/web/app/error.tsx
Matti Nannt 60f7103198 Revert & gradually use updated files (#280)
* revert to last working version

* add updated ui components

* update formbricks-com components

* apply prettier formatting

* update apps/web files
2023-05-10 00:20:43 +02:00

28 lines
740 B
TypeScript

"use client"; // Error components must be Client components
import { Button } from "@formbricks/ui";
import { ErrorComponent } from "@formbricks/ui";
import { useEffect } from "react";
export default function Error({ error, reset }: { error: Error; reset: () => void }) {
useEffect(() => {
// Log the error to an error reporting service
console.error(error);
}, [error]);
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>
);
}