-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb6612e
commit 3f87876
Showing
4 changed files
with
49 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Button } from "@/components/ui/button"; | ||
import { useNavigate } from "react-router-dom"; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
interface ErrorPageProps { | ||
code?: string | number; | ||
message?: string; | ||
} | ||
|
||
export default function ErrorPage({ code = "500", message }: ErrorPageProps) { | ||
const navigate = useNavigate(); | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<div className="flex flex-col items-center justify-center"> | ||
<div className="flex flex-col items-center gap-2"> | ||
<h1 className="text-4xl font-semibold">{code}</h1> | ||
<p className="text-xl text-muted-foreground"> | ||
{message || t("error.somethingWentWrong")} | ||
</p> | ||
<div className="flex gap-2"> | ||
<Button onClick={() => window.location.reload()} variant="outline"> | ||
{t("error.tryAgain")} | ||
</Button> | ||
<Button onClick={() => navigate("/")} className="mt-2"> | ||
{t("error.backToHome")} | ||
</Button> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |