import { Link } from '@vegaprotocol/ui-toolkit'; import { EtherscanLink, useEnvironment } from '@vegaprotocol/environment'; import { EthTxStatus } from '../use-ethereum-transaction'; import { useT } from '../use-t'; const ACTIVE_CLASSES = 'text-black dark:text-white'; export const ConfirmRow = ({ status }: { status: EthTxStatus }) => { const t = useT(); if (status === EthTxStatus.Requested) { return (

{t('Confirm transaction in wallet')}

); } return

{t('Confirmed in wallet')}

; }; interface TxRowProps { status: EthTxStatus; txHash: string | null; confirmations: number; requiredConfirmations: number; highlightComplete?: boolean; } export const TxRow = ({ status, txHash, confirmations, requiredConfirmations, highlightComplete = true, }: TxRowProps) => { const t = useT(); const { ETHERSCAN_URL } = useEnvironment(); if (status === EthTxStatus.Pending) { return (

{t( `Awaiting Ethereum transaction {{confirmations}}/{{requiredConfirmations}} confirmations...`, { confirmations, requiredConfirmations } )} {t('View on Etherscan')}

); } if (status === EthTxStatus.Complete) { return (

{t('Ethereum transaction complete')} {txHash && ( {t('View transaction on Etherscan')} )}

); } return

{t('Await Ethereum transaction')}

; }; interface ConfirmationEventRowProps { status: EthTxStatus; } export const ConfirmationEventRow = ({ status }: ConfirmationEventRowProps) => { const t = useT(); if (status !== EthTxStatus.Complete && status !== EthTxStatus.Confirmed) { return

{t('Vega confirmation')}

; } if (status === EthTxStatus.Complete) { return (

{t('Vega is confirming your transaction...')}

); } return (

{t('Transaction confirmed')}

); };