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

28 lines
603 B
JavaScript
Raw Normal View History

'use strict';
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 (
2015-06-12 13:36:55 +02:00
<span>
<input type="checkbox" onChange={this.selectItem} checked={this.props.selected}/>
</span>
2015-06-01 14:10:11 +02:00
);
}
});
export default TableItemCheckbox;