1
+ import { Button } from '@/components/ui/button' ;
1
2
import { isRouteErrorResponse , Link } from '@remix-run/react' ;
2
3
import ErrorPageBase from './ErrorPageBase' ;
3
4
@@ -11,33 +12,43 @@ export default function ErrorBoundaryPage({ error, notFoundItem }: Props) {
11
12
if ( error . status === 404 ) {
12
13
return (
13
14
< ErrorPageBase message = { `${ notFoundItem } が見つかりませんでした.` } title = "404 Not Found" >
14
- < Link to = "/" > ホームへ</ Link >
15
+ < Button asChild className = "mt-5" >
16
+ < Link to = "/" > ホームへ</ Link >
17
+ </ Button >
15
18
</ ErrorPageBase >
16
19
) ;
17
20
} else if ( error . status === 401 ) {
18
21
return (
19
22
< ErrorPageBase message = "認証に失敗しました." title = "401 Unauthorized" >
20
- < Link to = "/login" > ログイン</ Link >
23
+ < Button asChild className = "mt-5" >
24
+ < Link to = "/login" > ログイン</ Link >
25
+ </ Button >
21
26
</ ErrorPageBase >
22
27
) ;
23
28
} else if ( error . status === 500 ) {
24
29
return (
25
30
< ErrorPageBase message = "サーバーでエラーが発生しました.しばらくしてから再度お試しください" title = "500 Internal Server Error" >
26
- < Link to = "/" > ホームへ</ Link >
31
+ < Button asChild className = "mt-5" >
32
+ < Link to = "/" > ホームへ</ Link >
33
+ </ Button >
27
34
</ ErrorPageBase >
28
35
) ;
29
36
} else {
30
37
return (
31
38
< ErrorPageBase message = "エラーが発生しました." title = { `${ error . status } ${ error . statusText } ` } >
32
- < Link to = "/" > ホームへ</ Link >
39
+ < Button asChild className = "mt-5" >
40
+ < Link to = "/" > ホームへ</ Link >
41
+ </ Button >
33
42
</ ErrorPageBase >
34
43
) ;
35
44
}
36
45
} else if ( error instanceof Error ) {
37
46
return (
38
47
< div >
39
48
< ErrorPageBase message = "エラーが発生しました." title = "システムエラー" >
40
- < Link to = "/" > ホームへ</ Link >
49
+ < Button asChild className = "mt-5" >
50
+ < Link to = "/" > ホームへ</ Link >
51
+ </ Button >
41
52
< pre > { error . stack } </ pre >
42
53
</ ErrorPageBase >
43
54
</ div >
@@ -46,7 +57,9 @@ export default function ErrorBoundaryPage({ error, notFoundItem }: Props) {
46
57
47
58
return (
48
59
< ErrorPageBase message = "不明なエラーが発生しました." title = "不明なエラー" >
49
- < Link to = "/" > ホームへ</ Link >
60
+ < Button asChild className = "mt-5" >
61
+ < Link to = "/" > ホームへ</ Link >
62
+ </ Button >
50
63
</ ErrorPageBase >
51
64
) ;
52
65
}
0 commit comments