mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-26 19:00:22 -06:00
* revert to last working version * add updated ui components * update formbricks-com components * apply prettier formatting * update apps/web files
28 lines
740 B
TypeScript
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>
|
|
);
|
|
}
|