1 import React from 'react'
2 import { Link } from 'react-router'
8 } from 'features/shared/components'
9 import ExportKey from './ExportKey/ExportKey'
10 import componentClassNames from 'utility/componentClassNames'
12 class Show extends BaseShow {
17 showExportKey(item, lang){
20 <p>{lang === 'zh' ? `请输入密码然后导出${item.alias}的私钥:` : `Please enter the password and export ${item.alias}'s private key:`}</p>
22 key='export-key-form' // required by React
25 exportKey={this.props.exportKey}
32 const item = this.props.item
33 const lang = this.props.lang
38 {lang === 'zh' ? '密钥' : 'Keys '}
39 <code>{item.alias ? item.alias : item.id}</code>
42 view = <div className={componentClassNames(this)}>
51 title={lang === 'zh' ? '详情' : 'Details'}
53 <Link key='reset-password-btn' className='btn btn-link' to={`/keys/${item.id}/reset-password`}>{lang === 'zh' ? '重置密码' : 'Reset Password' }</Link>
56 {label: (lang === 'zh' ? '别名' : 'Alias' ), value: item.alias},
57 {label: (lang === 'zh' ? '主公钥' : 'xpub'), value: item.xpub},
64 return this.renderIfFound(view)
70 import {connect} from 'react-redux'
71 import actions from 'actions'
73 const mapStateToProps = (state, ownProps) => ({
74 item: state.key.items[ownProps.params.id],
78 const mapDispatchToProps = ( dispatch ) => ({
79 fetchItem: () => dispatch(actions.key.fetchItems()),
80 exportKey: (item, fileName) => dispatch(actions.key.createExport(item, fileName)),
81 showModal: (body) => dispatch(actions.app.showModal(
88 export default connect(