Download src/app/error.tsx from NAP1320/RotNot: direct link, hf CLI and curl.
- Browser
- Download file 2.28 kB
-
https://huggingface.co/spaces/NAP1320/RotNot/resolve/main/src/app/error.tsx
- Command line
-
hf download hf://spaces/NAP1320/RotNot/src/app/error.tsx
-
curl -L -o error.tsx https://huggingface.co/spaces/NAP1320/RotNot/resolve/main/src/app/error.tsx
2.28 kB
| "use client"; | |
| import { useEffect } from "react"; | |
| import Link from "next/link"; | |
| import { AlertTriangle, Home, RotateCcw } from "lucide-react"; | |
| export default function RootError({ | |
| error, | |
| reset, | |
| }: { | |
| error: Error & { digest?: string }; | |
| reset: () => void; | |
| }) { | |
| useEffect(() => { | |
| console.error("App error:", error); | |
| }, [error]); | |
| return ( | |
| <div className="flex items-center justify-center min-h-[60vh]"> | |
| <div className="flex flex-col items-center gap-5 text-center max-w-md px-4"> | |
| {/* Icon */} | |
| <div | |
| className="glass-md rounded-2xl p-5" | |
| style={{ | |
| background: "rgba(239, 68, 68, 0.1)", | |
| }} | |
| > | |
| <AlertTriangle size={36} style={{ color: "var(--destructive)" }} /> | |
| </div> | |
| {/* Heading */} | |
| <div> | |
| <h2 | |
| className="text-lg font-semibold mb-1" | |
| style={{ color: "var(--text-primary)" }} | |
| > | |
| Something went wrong | |
| </h2> | |
| <p className="text-sm" style={{ color: "var(--text-secondary)" }}> | |
| {error.message || "An unexpected error occurred."} | |
| </p> | |
| {error.digest && ( | |
| <p | |
| className="text-xs mt-2 font-mono" | |
| style={{ color: "var(--text-muted)" }} | |
| > | |
| Ref: {error.digest} | |
| </p> | |
| )} | |
| </div> | |
| {/* Actions */} | |
| <div className="flex items-center gap-3"> | |
| <button | |
| onClick={reset} | |
| className="inline-flex items-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium transition-all duration-150 hover:brightness-110" | |
| style={{ | |
| background: "var(--primary)", | |
| color: "var(--primary-foreground)", | |
| }} | |
| > | |
| <RotateCcw size={15} /> | |
| Try Again | |
| </button> | |
| <Link | |
| href="/" | |
| className="inline-flex items-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium transition-colors" | |
| style={{ | |
| background: "var(--surface-3)", | |
| color: "var(--text-secondary)", | |
| }} | |
| > | |
| <Home size={15} /> | |
| Dashboard | |
| </Link> | |
| </div> | |
| </div> | |
| </div> | |
| ); | |
| } | |