import React from 'react'; import { Link } from 'react-router-dom'; import translate from 'translations'; import { NewTabLink } from 'components/ui'; import { BlockExplorerConfig } from 'types/network'; import { getTXDetailsCheckURL } from 'libs/scheduling'; import { etherChainExplorerInst } from 'config/data'; export interface TransactionSucceededProps { txHash: string; blockExplorer?: BlockExplorerConfig; scheduling?: boolean; } const TransactionSucceeded = ({ txHash, blockExplorer, scheduling }: TransactionSucceededProps) => { let verifyBtn: React.ReactElement | undefined; let altVerifyBtn: React.ReactElement | undefined; if (blockExplorer) { verifyBtn = ( {translate('VERIFY_TX', { $block_explorer: blockExplorer.name })} ); } // TODO: In the future, we'll want to refactor staticNetworks so that multiple blockexplorers can be configured per network. // This requires a large refactor, so for now we'll hard-code the etherchain link when etherscan is shown to verify your transaction if (blockExplorer && blockExplorer.origin === 'https://etherscan.io') { altVerifyBtn = ( {translate('VERIFY_TX', { $block_explorer: etherChainExplorerInst.name })} ); } let scheduleDetailsBtn: React.ReactElement | undefined; if (scheduling) { scheduleDetailsBtn = ( {translate('SCHEDULE_CHECK')} ); } return (

{translate('SUCCESS_3')} {txHash}

{scheduleDetailsBtn} {verifyBtn} {altVerifyBtn} {translate('NAV_CHECKTXSTATUS')}
); }; export default TransactionSucceeded;