11"use client" ;
22
3- import React , { useEffect } from "react" ;
3+ import React , { useEffect , useState } from "react" ;
44import {
55 AlertCircle ,
66 RefreshCw ,
@@ -17,6 +17,10 @@ interface ErrorProps {
1717
1818// In this environment, the main component must be named App and be the default export
1919export default function App ( { error, reset } : ErrorProps ) {
20+ const [ errorTime ] = useState (
21+ ( ) => new Date ( ) . toISOString ( ) . split ( "T" ) [ 1 ] . split ( "." ) [ 0 ] ,
22+ ) ;
23+
2024 useEffect ( ( ) => {
2125 if ( error ) {
2226 console . error ( "Captured Error:" , error ) ;
@@ -105,25 +109,29 @@ export default function App({ error, reset }: ErrorProps) {
105109 </ div >
106110 < div className = "text-gray-500 text-xs flex justify-between" >
107111 < span > timestamp:</ span >
108- < span className = "text-gray-400" >
109- { new Date ( ) . toISOString ( ) . split ( "T" ) [ 1 ] . split ( "." ) [ 0 ] } UTC
110- </ span >
112+ < span className = "text-gray-400" > { errorTime } UTC</ span >
111113 </ div >
112114 < div className = "text-gray-500 text-xs flex justify-between" >
113115 < span > module:</ span >
114- < span className = "text-gray-400" > core/generator-v2.bin </ span >
116+ < span className = "text-gray-400" > { error ?. name ?? "Error" } </ span >
115117 </ div >
116118 </ div >
117- < div className = "flex gap-2 text-blue-400/80 pt-2" >
118- < span > ➜</ span >
119- < span className = "text-gray-400 italic" >
120- Self-healing protocol initiated...
121- </ span >
122- </ div >
123- < div className = "flex gap-2 text-green-400/80" >
124- < span > ✓</ span >
125- < span > Workspace state preserved. Ready for manual reset.</ span >
126- </ div >
119+ { process . env . NODE_ENV === "development" && (
120+ < >
121+ < div className = "flex gap-2 text-blue-400/80 pt-2" >
122+ < span > ➜</ span >
123+ < span className = "text-gray-400 italic" >
124+ Self-healing protocol initiated...
125+ </ span >
126+ </ div >
127+ < div className = "flex gap-2 text-green-400/80" >
128+ < span > ✓</ span >
129+ < span >
130+ Workspace state preserved. Ready for manual reset.
131+ </ span >
132+ </ div >
133+ </ >
134+ ) }
127135 </ div >
128136 </ div >
129137
@@ -147,7 +155,7 @@ export default function App({ error, reset }: ErrorProps) {
147155 < div >
148156 < h4 className = "font-bold text-sm" > State Recovery</ h4 >
149157 < p className = "text-xs text-gray-500" >
150- Cache has been purged to prevent recursive errors .
158+ Click "Try Again" to retry the failed operation .
151159 </ p >
152160 </ div >
153161 </ div >
0 commit comments