diff --git a/src/images/undraw_bug_fixing_oc-7-a.svg b/src/images/undraw_bug_fixing_oc-7-a.svg new file mode 100644 index 000000000..3da286cb4 --- /dev/null +++ b/src/images/undraw_bug_fixing_oc-7-a.svg @@ -0,0 +1 @@ +bug fixing \ No newline at end of file diff --git a/src/pages/_error.tsx b/src/pages/_error.tsx new file mode 100644 index 000000000..e59138184 --- /dev/null +++ b/src/pages/_error.tsx @@ -0,0 +1,83 @@ +import { + Accordion, + Center, + Group, + Stack, + Text, + Title, + createStyles, + useMantineTheme, +} from '@mantine/core'; +import { IconDeviceDesktop, IconInfoCircle, IconServer } from '@tabler/icons-react'; +import { NextPageContext } from 'next'; +import Head from 'next/head'; +import Image from 'next/image'; +import imageBugFixing from '~/images/undraw_bug_fixing_oc-7-a.svg'; + +function Error({ statusCode }: { statusCode: number }) { + const { classes } = useStyles(); + const theme = useMantineTheme(); + const getColor = (color: string) => theme.colors[color][theme.colorScheme === 'dark' ? 5 : 7]; + return ( +
+ + An error occurred • Homarr + + + bug illustration + An unexpected error has occurred + + This page has crashed unexpectedly. We're sorry for the inconvenience. Please try again or + contact an administrator + + + + + }> + Detailed error information + + + + + Type + + {statusCode ? ( + + + Server side + + ) : ( + + + Client side + + )} + + + + + + + +
+ ); +} + +Error.getInitialProps = ({ res, err }: NextPageContext) => { + const statusCode = res ? res.statusCode : err ? err.statusCode : 404; + return { statusCode }; +}; + +const useStyles = createStyles(() => ({ + root: { + margin: '0 auto', + }, + image: { + maxWidth: 400, + maxHeight: 200, + display: 'block', + margin: '0 auto', + }, +})); + +export default Error;