import React, {
	Component
} from 'react';
import {
	observer
} from 'mobx-react';
import {
	WeaDialogFooter,
	WeaLocaleProvider
} from 'ecCom';
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,
            resendVCode,
            sendBtnLabel
        } = store;
        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@smgrn4`} type={t > 0 ? 'default' : 'primary'} style={{float: 'left', marginLeft: 20}} onClick={resendVCode}>{sendBtnLabel}</Button>
            </div>
        )
	}
}