import React, {
	Component
} from 'react';
import {
	observer
} from 'mobx-react';
import {Button} from 'antd';
import {
	i18n
} from '../../public/i18n';

@observer
export default class Resend extends Component {
	constructor(props) {
		super(props);
	}

	render() {
        const {store} = this.props;
        const {
            showTimeout,
            t,
            getSecDynamicPassword,
            sendBtnLabel
        } = store;
        if(t == -1)
            return null;
        return (
            <div style={{float: 'left'}}>
                {/* {
                    showTimeout && <div style={{color: 'red', float: 'left', marginLeft: 20}}>{i18n.message.vCodeExpired()}</div>
                } */}
                <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@90mb4o`} type={t > 0 ? 'default' : 'primary'} style={{float: 'left', marginLeft: 20}} onClick={getSecDynamicPassword}>{sendBtnLabel}</Button>
            </div>
        )
	}
}