import React, { Suspense } from "react"; import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; import WarningHeader from "./WarningHeader"; import Home from "./Home"; import Main from "./Main"; import ConnectionErrorPanel from "./ConnectionErrorPanel"; import Footer from "./Footer"; import { ConnectionStatus } from "./types"; import { RuntimeContext, useRuntime } from "./useRuntime"; import { ChainInfoContext, useChainInfoFromMetadataFile } from "./useChainInfo"; const Block = React.lazy(() => import("./Block")); const BlockTransactions = React.lazy(() => import("./BlockTransactions")); const Address = React.lazy(() => import("./Address")); const Transaction = React.lazy(() => import("./Transaction")); const London = React.lazy(() => import("./special/london/London")); const Faucets = React.lazy(() => import("./Faucets")); const PageNotFound = React.lazy(() => import("./PageNotFound")); const App = () => { const runtime = useRuntime(); const chainInfo = useChainInfoFromMetadataFile(runtime); return ( {runtime.connStatus !== ConnectionStatus.CONNECTED || chainInfo === undefined ? ( ) : (
} /> } /> }> } /> } /> } /> } /> } /> } />
)}
); }; export default App;