import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { Button } from 'components/Form'

import { LOG } from 'utils'

export default class ChangePassWord extends Component {
    static propTypes = {
        onSuccess: PropTypes.func,
        styles: PropTypes.object
    }
    static defaultProps = {
        onSuccess: () => { LOG('修改密码成功prop未定义') }
    }

    handelReset = () => {
        this.props.onSuccess()
    }
    state = {errorInfo: '', loading: false}

    render () {
        const {styles} = this.props

        return (
            <div className={`${styles.register} ${styles.form}`}>
                <div >
                    <p className={styles.title}>重置密码</p>
                    <input className={`${styles.inputText} ${styles.pwd}`} placeholder='原始密码' type='password' />
                    <input className={`${styles.inputText} ${styles.pwd}`} placeholder='新密码' type='password' />
                    <input className={`${styles.inputText} ${styles.pwd}`} placeholder='重复新密码' type='password' />
                    <div className={styles.error}>{this.state.errorInfo}</div>
                    <Button onClick={this.handelReset}>确认</Button>
                </div>
            </div>
        )
    }
}
