Files
formbricks/apps/web/app/error.tsx
2024-09-26 12:08:21 +00:00

26 lines
758 B
TypeScript

"use client";
// Error components must be Client components
import { Button } from "@formbricks/ui/components/Button";
import { ErrorComponent } from "@formbricks/ui/components/ErrorComponent";
const 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 />
<div className="mt-2">
<Button variant="secondary" onClick={() => reset()} className="mr-2">
Try again
</Button>
<Button onClick={() => (window.location.href = "/")}>Go to Dashboard</Button>
</div>
</div>
);
};
export default Error;