var React = require('react');

function setRadio(id) {
    var radio = $('#' + id);
    radio[0].checked = true;
    radio.button("refresh");
}

var RadioButton = React.createClass({
    handleClick: function() {
        this.props.updateChecked(this.props.optionId);
    },
    render: function(){
        return (
            <div className="div-radiobutton" onClick={this.handleClick}>
                <input name="radio" id={this.props.optionId} type="radio" checked={this.props.isChecked} />
                {this.props.children}
            </div>
        );
    }
});


module.exports = RadioButton;
