import Modules , { ReduxStoreState } from "modules/root" ; import { i18nSelector } from "modules/settings/selectors" ; import React from "react" ; import { connect } from "react-redux" ; import { RouteComponentProps } from "react-router" ; import { composeWithProps } from "tools/context-utils" ; import PageAddressBar from "ui/PageAddressBar" ; import { Centered , View } from "ui/SharedComponents" ; import CeloTransactionDetail from "./CeloTransactionDetail" ; import CosmosTransactionDetail from "./CosmosTransactionDetail" ; import OasisTransactionDetail from "./OasisTransactionDetail" ; /** ===========================================================================
 * React Component
 * ============================================================================
 */ class TransactionDetailLoadingContainer extends React . PureComponent < IProps > { render ( ) { return ( < View > < PageAddressBar renderBackSquare pageTitle = { this . props . i18n . tString ( "Transaction Detail" ) } / > { this . renderTransaction ( ) } < /View>); } renderTransaction = ( ) => { const { network } = this . props . ledger ; if ( ! network . supportsTransactionsHistory ) { return ( < Centered style = { { flexDirection : "column" } } > < p > < b > { network . name } < /b> transaction history is not supported yet. < /p> < /Centered>); } switch ( network . name ) { case "TERRA" : case "COSMOS" : return < CosmosTransactionDetail />; case "CELO" : return < CeloTransactionDetail />; case "OASIS" : return < OasisTransactionDetail />; default : return null ; } } ; } /** ===========================================================================
 * Props
 * ============================================================================
 */ const mapStateToProps = ( state ) => ( { i18n : i18nSelector ( state ) , ledger : Modules . selectors . ledger . ledgerSelector ( state ) , } ) ; const withProps = connect ( mapStateToProps ) ; interface ComponentProps { } type ConnectProps = ReturnType < typeof mapStateToProps > ; interface IProps extends ConnectProps , RouteComponentProps , ComponentProps { } /** ===========================================================================
 * Export
 * ============================================================================
 */ export default composeWithProps < ComponentProps > ( withProps ) ( TransactionDetailLoadingContainer ) ;