import { Component } from "inferno"; import { Link } from "inferno-router"; import { IsoDataOptionalSite } from "shared/interfaces"; import { ErrorPageData, setIsoData } from "../../utils"; export class ErrorPage extends Component { private isoData: IsoDataOptionalSite = setIsoData(this.context); constructor(props: any, context: any) { super(props, context); } render() { const errorPageData = this.getErrorPageData(); return (

{errorPageData ? "Error!" : "Page Not Found"}

{errorPageData ? 'There was an error on the server. Try refreshing your browser. If that doesn\'t work, come back at a later time. If the problem persists, consider opening an issue.' : "The page you are looking for does not exist"}

{!errorPageData && ( Click here to return to your home page )} {errorPageData?.adminMatrixIds && errorPageData.adminMatrixIds.length > 0 && (
If you would like to reach out to one of{" "} {this.isoData.site_res?.site_view.site.name ?? "this instance"} 's admins for support, try the following Matrix addresses:
    {errorPageData.adminMatrixIds.map(matrixId => (
  • {matrixId}
  • ))}
)} {errorPageData?.error && ( {errorPageData.error} )}
); } private getErrorPageData() { const errorPageData = this.isoData.routeData[0] as | ErrorPageData | undefined; if (errorPageData?.type === "error") { return errorPageData; } return undefined; } }