1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00
onion/js/components/ascribe_table/table_item_checkbox.js
2015-06-01 14:10:11 +02:00

24 lines
545 B
JavaScript

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;