Path: blob/main/components/dashboard/src/error-pages/ErrorPages.tsx
2499 views
/**1* Copyright (c) 2023 Gitpod GmbH. All rights reserved.2* Licensed under the GNU Affero General Public License (AGPL).3* See License.AGPL.txt in the project root for license information.4*/56import { FC, Suspense, lazy } from "react";7import { Route, Switch, useRouteMatch } from "react-router";8import { AppLoading } from "../app/AppLoading";910const ExpiredOTS = lazy(() => import("./ExpiredOTS"));11const DefaultError = lazy(() => import("./DefaultError"));1213// Mounted under the `/error` path14// Intended to handle error pages we can redirect to w/ distinct urls15export const ErrorPages: FC = () => {16let match = useRouteMatch();1718return (19<Suspense fallback={<AppLoading />}>20<Switch>21{/* Matching /error/expired-ots */}22<Route path={`${match.path}/expired-ots`} exact component={ExpiredOTS} />23{/* Matching any error/* routes */}24<Route path={match.path} component={DefaultError} />25</Switch>26</Suspense>27);28};293031