-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.tsx
More file actions
31 lines (29 loc) · 842 Bytes
/
Copy patherror.tsx
File metadata and controls
31 lines (29 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'use client';
import { messages } from '@/i18n';
/**
* Route-level error boundary for the board. Next.js renders this client
* component whenever a server/client render in this segment throws (e.g. the
* backend is unreachable during SSR), with a reset() to retry.
*/
export default function BoardError({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
return (
<div className="error-box">
<h2 style={{ marginTop: 0 }}>{messages.errors.boardTitle}</h2>
<p style={{ color: 'var(--text-dim)' }}>
{error.message || messages.errors.boardBody}
</p>
<p style={{ color: 'var(--text-dim)', fontSize: 13 }}>
{messages.errors.boardHint}
</p>
<button className="btn" onClick={reset}>
{messages.errors.retry}
</button>
</div>
);
}