Skip to content

Commit 1083214

Browse files
committed
feat: add global error page
1 parent fbd909b commit 1083214

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

src/app/global-error.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"use client";
2+
3+
import { Inter } from "next/font/google";
4+
import { ToolHiveIcon } from "@/components/icons";
5+
import { Button } from "@/components/ui/button";
6+
import "./globals.css";
7+
8+
const inter = Inter({
9+
variable: "--font-inter",
10+
subsets: ["latin"],
11+
});
12+
13+
interface GlobalErrorProps {
14+
reset: () => void;
15+
}
16+
17+
export default function GlobalError({ reset }: GlobalErrorProps) {
18+
return (
19+
<html lang="en">
20+
<body
21+
className={`${inter.variable} antialiased bg-background text-foreground`}
22+
>
23+
<div className="flex flex-col items-center justify-center min-h-screen gap-6">
24+
<div className="flex items-center gap-2">
25+
<ToolHiveIcon className="size-8 shrink-0" />
26+
<span className="text-3xl font-bold tracking-tight">ToolHive</span>
27+
</div>
28+
29+
<h1 className="text-xl text-muted-foreground">
30+
Something went wrong
31+
</h1>
32+
33+
<Button onClick={reset} variant="default">
34+
Try again
35+
</Button>
36+
</div>
37+
</body>
38+
</html>
39+
);
40+
}

0 commit comments

Comments
 (0)