1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 09:35:10 +01:00
onion/js/components/ascribe_table/table_item_checkbox.js

24 lines
545 B
JavaScript
Raw Normal View History

2015-06-01 14:10:11 +02:00
import React from 'react';
let TableItemCheckbox = React.createClass({
propTypes: {
editionId: React.PropTypes.number,
pieceId: React.PropTypes.number,
selectItem: React.PropTypes.func,
selected: React.PropTypes.bool
},
selectItem() {
this.props.selectItem(this.props.pieceId, this.props.editionId);
},
render() {
return (
<input type="checkbox" onChange={this.selectItem} checked={this.props.selected}/>
);
}
});
export default TableItemCheckbox;