@mdguggenbichler/slugbase-core 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/frontend/src/App.tsx +8 -6
- package/package.json +1 -1
package/frontend/src/App.tsx
CHANGED
|
@@ -137,14 +137,16 @@ interface AppErrorFallbackProps {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
function AppErrorFallback({ error, onReset }: AppErrorFallbackProps) {
|
|
140
|
-
|
|
140
|
+
// Use hardcoded strings so this fallback never throws (e.g. when i18n context is missing in embedded host).
|
|
141
141
|
const message = error?.message ?? (error != null ? String(error) : '');
|
|
142
142
|
return (
|
|
143
143
|
<div className="min-h-screen flex flex-col items-center justify-center gap-4 p-4" role="alert">
|
|
144
|
-
<p className="text-lg text-gray-700 dark:text-gray-300 text-center">
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
<p className="text-lg text-gray-700 dark:text-gray-300 text-center">
|
|
145
|
+
Something went wrong loading this page. Please try again.
|
|
146
|
+
</p>
|
|
147
|
+
{(message || error?.stack) && (
|
|
148
|
+
<details className="w-full max-w-md text-sm text-gray-600 dark:text-gray-400" open>
|
|
149
|
+
<summary className="cursor-pointer">{message || 'Error details'}</summary>
|
|
148
150
|
{error?.stack && <pre className="mt-2 overflow-auto whitespace-pre-wrap">{error.stack}</pre>}
|
|
149
151
|
</details>
|
|
150
152
|
)}
|
|
@@ -153,7 +155,7 @@ function AppErrorFallback({ error, onReset }: AppErrorFallbackProps) {
|
|
|
153
155
|
onClick={() => (onReset ? onReset() : window.location.reload())}
|
|
154
156
|
className="px-4 py-2 rounded-md bg-primary text-primary-foreground hover:opacity-90"
|
|
155
157
|
>
|
|
156
|
-
|
|
158
|
+
Reload
|
|
157
159
|
</button>
|
|
158
160
|
</div>
|
|
159
161
|
);
|