aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/app
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-09-14 09:56:18 +0000
committerMohamed Bassem <me@mbassem.com>2025-09-14 09:56:18 +0000
commitd53b28261cecdb093128f59acf15af3e7919d3ca (patch)
tree0d2b0680092686d57de07054de706a18ee12012c /apps/web/app
parentd173b101e3c9d48d59d380f4433dbea53dae5c89 (diff)
downloadkarakeep-d53b28261cecdb093128f59acf15af3e7919d3ca.tar.zst
feat: A better looking catch all error boundary
Diffstat (limited to '')
-rw-r--r--apps/web/app/dashboard/error.tsx41
1 files changed, 39 insertions, 2 deletions
diff --git a/apps/web/app/dashboard/error.tsx b/apps/web/app/dashboard/error.tsx
index 556e59a3..2577d2bf 100644
--- a/apps/web/app/dashboard/error.tsx
+++ b/apps/web/app/dashboard/error.tsx
@@ -1,9 +1,46 @@
"use client";
+import Link from "next/link";
+import { Button } from "@/components/ui/button";
+import { AlertTriangle, Home, RefreshCw } from "lucide-react";
+
export default function Error() {
return (
- <div className="flex size-full">
- <div className="m-auto text-3xl">Something went wrong</div>
+ <div className="flex flex-1 items-center justify-center rounded-lg bg-slate-50 p-8 shadow-sm dark:bg-slate-700/50 dark:shadow-md">
+ <div className="w-full max-w-md space-y-8 text-center">
+ {/* Error Icon */}
+ <div className="flex justify-center">
+ <div className="flex h-20 w-20 items-center justify-center rounded-full bg-muted">
+ <AlertTriangle className="h-10 w-10 text-muted-foreground" />
+ </div>
+ </div>
+
+ {/* Main Content */}
+ <div className="space-y-4">
+ <h1 className="text-balance text-2xl font-semibold text-foreground">
+ Oops! Something went wrong
+ </h1>
+ <p className="text-pretty leading-relaxed text-muted-foreground">
+ We&apos;re sorry, but an unexpected error occurred. Please try again
+ or contact support if the issue persists.
+ </p>
+ </div>
+
+ {/* Action Buttons */}
+ <div className="space-y-3">
+ <Button className="w-full" onClick={() => window.location.reload()}>
+ <RefreshCw className="mr-2 h-4 w-4" />
+ Try Again
+ </Button>
+
+ <Link href="/" className="block">
+ <Button variant="outline" className="w-full">
+ <Home className="mr-2 h-4 w-4" />
+ Go Home
+ </Button>
+ </Link>
+ </div>
+ </div>
</div>
);
}