mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-18 02:32:04 -05:00
## Changes 🏗️ Moving non-design-system components ( old ) to a `components/__legacy__` folder 📁 so like this is more obvious for developers that they should not import them or use them on new features. What is now top-level in `/components` is what it is actively maintained. Document some existing components like `<Alert />`. More on this coming on follow-up PRs. ## Checklist 📋 ### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [x] Test and types pass on the CI - [x] Run app locally, click around, looks good ### For configuration changes: None
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
"use client";
|
|
|
|
import { useEffect } from "react";
|
|
import { IconCircleAlert } from "@/components/__legacy__/ui/icons";
|
|
import { Button } from "@/components/__legacy__/ui/button";
|
|
import Link from "next/link";
|
|
|
|
export default function Error({
|
|
error,
|
|
reset,
|
|
}: {
|
|
error: Error & { digest?: string };
|
|
reset: () => void;
|
|
}) {
|
|
useEffect(() => {
|
|
console.error(error);
|
|
}, [error]);
|
|
|
|
return (
|
|
<div className="fixed inset-0 flex items-center justify-center bg-background">
|
|
<div className="w-full max-w-md px-4 text-center sm:px-6">
|
|
<div className="mx-auto flex size-12 items-center justify-center rounded-full bg-muted">
|
|
<IconCircleAlert className="size-10" />
|
|
</div>
|
|
<h1 className="mt-8 text-2xl font-bold tracking-tight text-foreground">
|
|
Oops, something went wrong!
|
|
</h1>
|
|
<p className="mt-4 text-muted-foreground">
|
|
We're sorry, but an unexpected error has occurred. Please try
|
|
again later or contact support if the issue persists.
|
|
</p>
|
|
<div className="mt-6 flex flex-row justify-center gap-4">
|
|
<Button onClick={reset} variant="outline">
|
|
Retry
|
|
</Button>
|
|
<Button>
|
|
<Link href="/">Go to Homepage</Link>
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|