trc-client-core
Version:
The core of the TRC Client
34 lines (31 loc) • 1 kB
JSX
var React = require('react');
var _ = require('lodash');
var RadioButton = require('bd-stampy/components/RadioButton');
var StarRatingInput = React.createClass({
getDefaultProps: function () {
return {
length: 5
};
},
onChange: function(e, details){
if(this.props.onClick){
this.props.onClick(e, details);
}
},
render: function() {
return (
<div className={`StarRating StarRating-${this.props.department}`}>
{_.map(_.range(this.props.length), (data, key) => {
return <RadioButton
key={key}
className="Star"
onChange={this.onChange}
name={this.props.name.toString()}
value={data}
/>;
})}
</div>
);
}
});
module.exports = StarRatingInput;