Files
explore/pages/_error.tsx
T
tom goriunovandGitHub 9b1d5fa1a0 refine Sentry setup (#1229)
* [skip ci] reusable workflow for publishing docker image

* [skip ci] clean up

* remove sentry/nextjs

* refine config and fetch error payload

* log 404

* make ENV variables for instance and enviroment optional

* add release and enviroment to csp
2023-10-02 13:46:28 -03:00

18 lines
560 B
TypeScript

import NextErrorComponent from 'next/error';
import React from 'react';
import type { Props as ServerSidePropsCommon } from 'nextjs/getServerSideProps';
import * as cookies from 'lib/cookies';
type Props = ServerSidePropsCommon & {
statusCode: number;
}
const CustomErrorComponent = (props: Props) => {
const colorModeCookie = cookies.getFromCookieString(props.cookies || '', cookies.NAMES.COLOR_MODE);
return <NextErrorComponent statusCode={ props.statusCode } withDarkMode={ colorModeCookie === 'dark' }/>;
};
export default CustomErrorComponent;