1+ import { Button } from '@/components/ui/button' ;
12import { isRouteErrorResponse , Link } from '@remix-run/react' ;
23import ErrorPageBase from './ErrorPageBase' ;
34
@@ -11,33 +12,43 @@ export default function ErrorBoundaryPage({ error, notFoundItem }: Props) {
1112 if ( error . status === 404 ) {
1213 return (
1314 < ErrorPageBase message = { `${ notFoundItem } が見つかりませんでした.` } title = "404 Not Found" >
14- < Link to = "/" > ホームへ</ Link >
15+ < Button asChild className = "mt-5" >
16+ < Link to = "/" > ホームへ</ Link >
17+ </ Button >
1518 </ ErrorPageBase >
1619 ) ;
1720 } else if ( error . status === 401 ) {
1821 return (
1922 < ErrorPageBase message = "認証に失敗しました." title = "401 Unauthorized" >
20- < Link to = "/login" > ログイン</ Link >
23+ < Button asChild className = "mt-5" >
24+ < Link to = "/login" > ログイン</ Link >
25+ </ Button >
2126 </ ErrorPageBase >
2227 ) ;
2328 } else if ( error . status === 500 ) {
2429 return (
2530 < ErrorPageBase message = "サーバーでエラーが発生しました.しばらくしてから再度お試しください" title = "500 Internal Server Error" >
26- < Link to = "/" > ホームへ</ Link >
31+ < Button asChild className = "mt-5" >
32+ < Link to = "/" > ホームへ</ Link >
33+ </ Button >
2734 </ ErrorPageBase >
2835 ) ;
2936 } else {
3037 return (
3138 < ErrorPageBase message = "エラーが発生しました." title = { `${ error . status } ${ error . statusText } ` } >
32- < Link to = "/" > ホームへ</ Link >
39+ < Button asChild className = "mt-5" >
40+ < Link to = "/" > ホームへ</ Link >
41+ </ Button >
3342 </ ErrorPageBase >
3443 ) ;
3544 }
3645 } else if ( error instanceof Error ) {
3746 return (
3847 < div >
3948 < ErrorPageBase message = "エラーが発生しました." title = "システムエラー" >
40- < Link to = "/" > ホームへ</ Link >
49+ < Button asChild className = "mt-5" >
50+ < Link to = "/" > ホームへ</ Link >
51+ </ Button >
4152 < pre > { error . stack } </ pre >
4253 </ ErrorPageBase >
4354 </ div >
@@ -46,7 +57,9 @@ export default function ErrorBoundaryPage({ error, notFoundItem }: Props) {
4657
4758 return (
4859 < ErrorPageBase message = "不明なエラーが発生しました." title = "不明なエラー" >
49- < Link to = "/" > ホームへ</ Link >
60+ < Button asChild className = "mt-5" >
61+ < Link to = "/" > ホームへ</ Link >
62+ </ Button >
5063 </ ErrorPageBase >
5164 ) ;
5265}
0 commit comments