mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-11 08:42:39 +02:00
fix: enhance GlobalError component with improved UI and error handling
This commit is contained in:
parent
420eed01ea
commit
5d9751bcd5
1 changed files with 28 additions and 17 deletions
|
|
@ -1,8 +1,16 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import "./globals.css";
|
||||||
|
|
||||||
import NextError from "next/error";
|
import NextError from "next/error";
|
||||||
import posthog from "posthog-js";
|
import posthog from "posthog-js";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
|
export const metadata = {
|
||||||
|
title: "SurfSense - Error",
|
||||||
|
description: "SurfSense Error Page",
|
||||||
|
};
|
||||||
|
|
||||||
export default function GlobalError({
|
export default function GlobalError({
|
||||||
error,
|
error,
|
||||||
|
|
@ -18,10 +26,13 @@ export default function GlobalError({
|
||||||
return (
|
return (
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<body>
|
<body>
|
||||||
<NextError statusCode={0} />
|
<div className="flex min-h-screen flex-col items-center justify-center gap-4 p-4">
|
||||||
<button type="button" onClick={reset}>
|
<h2 className="text-xl font-semibold">Something went wrong</h2>
|
||||||
Try again
|
<p className="text-sm text-muted-foreground">
|
||||||
</button>
|
An unexpected error occurred.
|
||||||
|
</p>
|
||||||
|
<Button onClick={reset}>Try again</Button>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue