// @flow import React from 'react'; import Button from 'component/button'; import { Form } from 'component/common/form'; import { Modal } from 'modal/modal'; import Card from 'component/common/card'; import LbcSymbol from 'component/common/lbc-symbol'; import ClaimPreview from 'component/claimPreview'; type TipParams = { amount: number, claim_id: string, channel_id?: string }; type Props = { destination: string, amount: number, closeModal: () => void, sendToAddress: (string, number) => void, sendTip: (TipParams, boolean) => void, isAddress: boolean, claim: StreamClaim, activeChannelClaim: ?ChannelClaim, incognito: boolean, setConfirmed: (boolean) => void, }; class ModalConfirmTransaction extends React.PureComponent { onConfirmed() { const { closeModal, sendToAddress, sendTip, amount, destination, isAddress, claim, setConfirmed } = this.props; if (!isAddress) { const claimId = claim && claim.claim_id; const tipParams: TipParams = { amount: amount, claim_id: claimId }; sendTip(tipParams, false); } else { sendToAddress(destination, amount); } setConfirmed(true); closeModal(); } render() { const { amount, destination, closeModal, isAddress, incognito, activeChannelClaim } = this.props; const activeChannelUrl = activeChannelClaim && activeChannelClaim.canonical_url; const title = __('Confirm Transaction'); return (
this.onConfirmed()}>
{__('Sending')}
{}
{!isAddress &&
{__('From')}
} {!isAddress && (
{incognito ? ( 'Anonymous' ) : ( )}
)}
{__('To')}
{!isAddress ? ( ) : ( destination )}
} actions={ <>

{__('Once the transaction is sent, it cannot be reversed.')}

} />
); } } export default ModalConfirmTransaction;