import React from 'react';
require('./index.css');

export default class ButtonComponent extends React.Component{
    constructor(props){
        super(props);
        this.handleButtonClick = this.handleButtonClick.bind(this)
    }

    handleButtonClick(){
        let props = this.props;
        let {option=null} = props;
        if(option){
            option();
        }
    }

    render(){
        let props = this.props;
        let {btnContainer="",style={}} = props;
        return(
            <div className={`buttonComponent ${btnContainer}`} style={style} onClick={this.handleButtonClick}>
                {props.text}
            </div>
        )
    }
}