diff options
Diffstat (limited to 'thallium-frontend/src')
| -rw-r--r-- | thallium-frontend/src/pages/ErrorPage.tsx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/thallium-frontend/src/pages/ErrorPage.tsx b/thallium-frontend/src/pages/ErrorPage.tsx new file mode 100644 index 0000000..a649e25 --- /dev/null +++ b/thallium-frontend/src/pages/ErrorPage.tsx @@ -0,0 +1,33 @@ +import { useRouteError } from 'react-router-dom'; + +import Card from '../components/Card'; + +const LandingPage = () => { + const error: any = useRouteError() || {}; + + let title, message, isUnexpected = false; + + if (error.status === 404) { + title = 'Not Found'; + message = 'The requested page could not be found.'; + } else { + title = 'Error'; + message = error.message || error.statusText; + isUnexpected = true; + } + + return ( + <> + <div> + <Card title={title}> + {isUnexpected && <strong>An error occurred:</strong>} + <p> + {message} + </p> + </Card> + </div> + </> + ); +}; + +export default LandingPage; |