1 import React from 'react'
8 } from 'features/shared/components'
9 import { Link } from 'react-router'
10 import componentClassNames from 'utility/componentClassNames'
11 import { btmID } from 'utility/environment'
12 import { withNamespaces } from 'react-i18next'
14 class AssetShow extends BaseShow {
16 const { item, t } = this.props
22 <code>{item.alias ? item.alias :item.id}</code>
25 const time = (item.limitHeight-this.props.blockHeight) *2.5
27 if(this.props.blockHeight<item.limitHeight){
28 assetLabel = <span className='text-danger'>{t('asset.issuableLabel',{time:time})}</span>
29 }else if(item.limitHeight>0){
30 assetLabel = <span className='text-danger'>{t('asset.noIssuableLabel')}</span>
33 view = <div className={componentClassNames(this)}>
37 item.id!==btmID && <Link key='create-asset-btn' className='btn btn-link' to={`/transactions/create?type=issueAsset&alias=${item.alias}`}>{t('transaction.issue.issueAsset')}</Link>,
45 title={t('form.detail')}
47 <RawJsonButton key='raw-json' item={item} />
50 {label: 'ID', value: item.id},
51 {label: t('form.alias'), value: item.alias, editUrl: item.alias === 'BTM' ? null : `/assets/${item.id}/alias`},
52 {label: t('form.symbol'), value: item.definition.symbol},
53 {label: t('form.decimals'), value: item.definition.decimals},
54 {label: t('form.reissueTitle'), value: (item.alias === 'BTM' || item.limitHeight > 0)? 'false ': 'true', note: assetLabel},
55 {label: t('form.xpubs'), value: (item.xpubs || []).length},
56 {label: t('form.quorum'), value: item.quorum},
57 {label: t('asset.additionInfo'), value: item.definition.description},
61 {(item.xpubs || []).map((key, index) =>
64 title={t('asset.xpubs', {id: index + 1})}
66 {label: t('form.index') , value: index},
67 {label: t('asset.assetPub') , value: key},
74 return this.renderIfFound(view)
80 import { connect } from 'react-redux'
81 import actions from 'actions'
83 const mapStateToProps = (state, ownProps) => ({
84 item: state.asset.items[ownProps.params.id],
85 blockHeight: state.core.blockHeight
88 const mapDispatchToProps = ( dispatch ) => ({
89 fetchItem: (id) => dispatch(actions.asset.fetchItems({id: `${id}`})),
90 showCirculation: (item) => {
91 let filter = `id='${item.id}'`
93 filter = `alias='${item.alias}'`
96 dispatch(actions.balance.pushList({ filter }))
101 export default withNamespaces('translations') ( connect(