diff --git a/package-lock.json b/package-lock.json index ca4168b..048f5da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ "eslint": "^9", "eslint-config-next": "16.1.6", "tailwindcss": "^4", + "tailwindcss-animate": "^1.0.7", "typescript": "5.9.3", "vitest": "^4.0.18" } @@ -9576,6 +9577,16 @@ "license": "MIT", "peer": true }, + "node_modules/tailwindcss-animate": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/tailwindcss-animate/-/tailwindcss-animate-1.0.7.tgz", + "integrity": "sha512-bl6mpH3T7I3UFxuvDEXLxy/VuFxBk5bbzplh7tXI68mwMokNYd1t9qPBHlnyTwfa4JGC4zP516I1hYYtQ/vspA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "tailwindcss": ">=3.0.0 || insiders" + } + }, "node_modules/tapable": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", diff --git a/package.json b/package.json index 6659630..c0b72ab 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "eslint": "^9", "eslint-config-next": "16.1.6", "tailwindcss": "^4", + "tailwindcss-animate": "^1.0.7", "typescript": "5.9.3", "vitest": "^4.0.18" } diff --git a/src/app/error.tsx b/src/app/error.tsx new file mode 100644 index 0000000..8f5388b --- /dev/null +++ b/src/app/error.tsx @@ -0,0 +1,174 @@ +"use client"; + +import React, { useEffect, useState } from "react"; +import { + AlertCircle, + RefreshCw, + Home, + Terminal, + ShieldAlert, +} from "lucide-react"; +import Link from "next/link"; + +interface ErrorProps { + error?: Error & { digest?: string }; + reset?: () => void; +} + +// In this environment, the main component must be named App and be the default export +export default function App({ error, reset }: ErrorProps) { + const [errorTime] = useState( + () => new Date().toISOString().split("T")[1].split(".")[0], + ); + + useEffect(() => { + if (error) { + console.error("Captured Error:", error); + } + }, [error]); + + // Fallback values in case props are undefined during a manual preview or direct render + const errorMessage = + error?.message || "An unexpected system interruption occurred."; + const errorDigest = error?.digest || "N/A"; + const handleReset = reset || (() => window.location.reload()); + + return ( +
+ {/* Background Glows - Red/Amber for Error Context */} +
+
+ +
+ {/* Error Badge - Replicating the style from mainpage.png */} +
+ + Runtime Exception Detected +
+ + {/* Hero Title with Gradient Text */} +

+ Something went
+ + wrong. + +

+ +

+ An unexpected error occurred during the generation process. The + codebase remains secure, but the current operation was halted. +

+ + {/* Action Buttons */} +
+ + + + Return Home + +
+ + {/* Debugging Terminal - Visual match for terminal in mainpage.png */} +
+
+
+
+
+
+
+
+ + STACK_TRACE_SNAPSHOT +
+
+
+
+ + [CRITICAL] + + + {errorMessage} + +
+
+
+ digest: + {errorDigest} +
+
+ timestamp: + {errorTime} UTC +
+
+ module: + {error?.name ?? "Error"} +
+
+ {process.env.NODE_ENV === "development" && ( + <> +
+ + + Self-healing protocol initiated... + +
+
+ + + Workspace state preserved. Ready for manual reset. + +
+ + )} +
+
+ + {/* Replicating feature-page.png style for secondary info */} +
+
+
+ +
+
+

IP Protected

+

+ Your code was not compromised during this crash. +

+
+
+
+
+ +
+
+

State Recovery

+

+ Click "Try Again" to retry the failed operation. +

+
+
+
+
+ + {/* Brand Footer */} +
+
+ R +
+ ReadmeGenAI +
+
+ ); +} diff --git a/src/app/generate/GeneratePageClient.tsx b/src/app/generate/GeneratePageClient.tsx index a857644..8980251 100644 --- a/src/app/generate/GeneratePageClient.tsx +++ b/src/app/generate/GeneratePageClient.tsx @@ -4,7 +4,7 @@ import { Navbar } from "@/components/layout/Navbar"; import { Footer } from "@/components/layout/Footer"; import { SearchInput } from "@/components/Generator/SearchInput"; import { MarkdownPreview } from "@/components/Generator/MarkdownPreview"; -import { LoadingOverlay } from "@/components/Generator/LoadingOverlay"; +import LoadingOverlay from "@/components/Generator/LoadingOverlay"; import { navLinks } from "@/constants/navLinks"; import { TerminalMockup } from "@/components/sections/TerminalMockup"; diff --git a/src/app/globals.css b/src/app/globals.css index a2dc41e..062cddc 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,4 +1,5 @@ @import "tailwindcss"; +@plugin "tailwindcss-animate"; :root { --background: #ffffff; diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index 263b197..8ba458b 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -38,16 +38,15 @@ export default function NotFound() { {/* CTA Buttons */}
- + +