diff --git a/src/pages/404.tsx b/src/pages/404.tsx index 1c53760..d3e5a77 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -1,17 +1,27 @@ -import { Link } from 'react-router-dom' +import { Link, useRouteError } from 'react-router-dom' import { appRoutes } from 'routes' -export const NotFoundPage = () => { +interface NotFoundPageProps { + title: string + message: string +} + +export const NotFoundPage = ({ + title = 'Page not found', + message = "The page you're attempting to visit doesn't exist" +}: Partial) => { + const error = useRouteError() as Partial + return (
-

Page not found

+

{error?.title || title}

-

The page you're attempting to visit doesn't exist

+

{error?.message || message}