23 lines
697 B
TypeScript
23 lines
697 B
TypeScript
// Copyright 2017-2020 @polkadot/apps authors & contributors
|
|
// This software may be modified and distributed under the terms
|
|
// of the Apache-2.0 license. See the LICENSE file for details.
|
|
|
|
import { RouteProps } from '@polkadot/apps-routing/types';
|
|
|
|
import React from 'react';
|
|
import { Redirect } from 'react-router';
|
|
|
|
interface Props extends RouteProps {
|
|
missingApis?: (string | string[])[];
|
|
}
|
|
|
|
function NotFound ({ basePath, missingApis = [] }: Props): React.ReactElement {
|
|
console.log(`Redirecting from route "${basePath}" to "explorer", missing the following APIs: ${JSON.stringify(missingApis)}`);
|
|
|
|
return (
|
|
<Redirect to='/explorer' />
|
|
);
|
|
}
|
|
|
|
export default React.memo(NotFound);
|