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"; const Block = React.lazy( () => import(/* webpackChunkName: "block", webpackPrefetch: true */ "./Block") ); const BlockTransactions = React.lazy( () => import( /* webpackChunkName: "blocktxs", webpackPrefetch: true */ "./BlockTransactions" ) ); const Address = React.lazy( () => import(/* webpackChunkName: "address", webpackPrefetch: true */ "./Address") ); const Transaction = React.lazy( () => import(/* webpackChunkName: "tx", webpackPrefetch: true */ "./Transaction") ); const London = React.lazy( () => import( /* webpackChunkName: "london", webpackPrefetch: true */ "./special/london/London" ) ); const PageNotFound = React.lazy( () => import( /* webpackChunkName: "notfound", webpackPrefetch: true */ "./PageNotFound" ) ); const App = () => { const runtime = useRuntime(); return ( {runtime.connStatus !== ConnectionStatus.CONNECTED ? ( ) : (
} /> } /> }> } /> } /> } /> } /> } />
)}
); }; export default App;