mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* [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
18 lines
560 B
TypeScript
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;
|