mirror of
https://github.com/status-im/status-tutorials.git
synced 2026-08-31 12:11:10 +00:00
42 lines
851 B
TypeScript
42 lines
851 B
TypeScript
// #region Global Imports
|
|
import * as React from "react";
|
|
import { NextPage } from "next";
|
|
// #endregion Global Imports
|
|
|
|
// #region Local Imports
|
|
import { withTranslation } from "@Server/i18n";
|
|
// #endregion Local Imports
|
|
|
|
// #region Interface Imports
|
|
import { IErrorPage } from "@Interfaces";
|
|
// #endregion Interface Imports
|
|
|
|
const Error: NextPage<IErrorPage.IProps, IErrorPage.InitialProps> = ({
|
|
t,
|
|
statusCode,
|
|
}) => {
|
|
return (
|
|
<div>
|
|
{t("common:Error")}
|
|
{statusCode}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
Error.getInitialProps = async ({ res, err }) => {
|
|
let statusCode;
|
|
|
|
if (res) {
|
|
({ statusCode } = res);
|
|
} else if (err) {
|
|
({ statusCode } = err);
|
|
}
|
|
|
|
return {
|
|
namespacesRequired: ["common"],
|
|
statusCode,
|
|
};
|
|
};
|
|
|
|
export default withTranslation("common")(Error);
|