import {WeaInput} from 'ecCom';
import {Button} from 'antd';

class Main extends React.Component {
  constructor(props) {
    super(props);
  }
  onBtnClick = () => {
    this.props.onBtnClick &&　this.props.onBtnClick(this.props.value);
  }
  render() {
    const {props} = this;
    const {viewAttr} = props;
    return (
      <div className="hrm-input-btn">
        <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@9ze5u3`} {...props} />
        {
          viewAttr!='1' && <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@xjfmk5`} type="primary" onClick={this.onBtnClick}>{props.btnText}</Button>
        }
      </div>
    )
  }
}
export default Main;