1 import React from 'react'
2 import { connect } from 'react-redux'
3 import { NotFound, PageContent, PageTitle } from 'features/shared/components'
4 import styles from './GeneratedTxHex.scss'
5 import { copyToClipboard } from 'utility/clipboard'
7 class Generated extends React.Component {
9 if (!this.props.hex) return <NotFound />
13 <PageTitle title='Generated Transaction' />
16 <div className={styles.main}>
17 <p>Use the following JSON string as the transaction to sign by another account:</p>
20 className='btn btn-primary'
21 onClick={() => copyToClipboard(this.props.hex)}
26 <pre className={styles.hex}>{this.props.hex}</pre>
34 export default connect(
36 (state, ownProps) => {
37 const generated = (state.transaction || {}).generated || []
38 const found = generated.find(i => i.id == ownProps.params.id)
39 if (found) return {hex: found.hex}