diff --git a/src/app/error.tsx b/src/app/error.tsx new file mode 100644 index 00000000..eca15321 --- /dev/null +++ b/src/app/error.tsx @@ -0,0 +1,11 @@ +'use client'; + +import HttpStatusPage from '@/components/HttpStatusPage'; + +export default function Error() { + return ( + + Something went wrong + + ); +} diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index 7d188b74..aca6aeaa 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -1,45 +1,22 @@ 'use client'; -import SiteGrid from '@/components/SiteGrid'; -import { PATH_ROOT } from '@/site/paths'; +import HttpStatusPage from '@/components/HttpStatusPage'; import { clsx } from 'clsx/lite'; -import Link from 'next/link'; import { usePathname } from 'next/navigation'; export default function NotFound() { const pathname = usePathname(); return ( - + - - 404 - - - - - {pathname} - - {' '} - could not be found - - - Return Home - - - - } /> + {pathname} + + {' '} + could not be found + ); } diff --git a/src/components/HttpStatusPage.tsx b/src/components/HttpStatusPage.tsx new file mode 100644 index 00000000..0abe6ec0 --- /dev/null +++ b/src/components/HttpStatusPage.tsx @@ -0,0 +1,39 @@ +import { ReactNode } from 'react'; +import SiteGrid from './SiteGrid'; +import { clsx } from 'clsx/lite'; +import { PATH_ROOT } from '@/site/paths'; +import Link from 'next/link'; + +export default function HttpStatusPage({ + status, + children, +}: { + status: number + children?: ReactNode +}) { + return ( + + + {status} + + + {children && + {children}} + + Return Home + + + + } /> + ); +}