1 import { Component } from "inferno";
2 import { Link } from "inferno-router";
3 import { IsoDataOptionalSite } from "shared/interfaces";
4 import { ErrorPageData, setIsoData } from "../../utils";
6 export class ErrorPage extends Component<any, any> {
7 private isoData: IsoDataOptionalSite = setIsoData(this.context);
9 constructor(props: any, context: any) {
10 super(props, context);
14 const errorPageData = this.getErrorPageData();
17 <div className="container-lg text-center">
18 <h1>{errorPageData ? "Error!" : "Page Not Found"}</h1>
21 ? '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, <a href="https://github.com/LemmyNet/lemmy/issues">consider opening an issue.</a>'
22 : "The page you are looking for does not exist"}
25 <Link to="/">Click here to return to your home page</Link>
27 {errorPageData?.adminMatrixIds &&
28 errorPageData.adminMatrixIds.length > 0 && (
31 If you would like to reach out to one of{" "}
32 {this.isoData.site_res?.site_view.site.name ?? "this instance"}
33 's admins for support, try the following Matrix addresses:
36 {errorPageData.adminMatrixIds.map(matrixId => (
37 <li key={matrixId}>{matrixId}</li>
42 {errorPageData?.error && (
43 <code className="text-start">{errorPageData.error}</code>
49 private getErrorPageData() {
50 const errorPageData = this.isoData.routeData[0] as
53 if (errorPageData?.type === "error") {