2014-11-01 15:19:10 +01:00
|
|
|
var React = require('react');
|
|
|
|
|
2014-11-01 15:53:14 +01:00
|
|
|
var Strategy = React.createClass({
|
2014-11-01 15:19:10 +01:00
|
|
|
propTypes: {
|
2014-11-01 15:53:14 +01:00
|
|
|
strategy: React.PropTypes.object.isRequired
|
2014-11-01 15:19:10 +01:00
|
|
|
},
|
|
|
|
|
2014-12-09 09:22:54 +01:00
|
|
|
onRemove: function(event) {
|
|
|
|
event.preventDefault();
|
2015-03-23 18:47:23 +01:00
|
|
|
if (window.confirm("Are you sure you want to delete strategy '"+
|
|
|
|
this.props.strategy.name+"'?")) {
|
2014-12-09 09:22:54 +01:00
|
|
|
this.props.onRemove(this.props.strategy);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2014-11-01 15:19:10 +01:00
|
|
|
render: function() {
|
2014-11-01 15:53:14 +01:00
|
|
|
return (
|
|
|
|
<div className="line mal">
|
2014-11-03 21:27:47 +01:00
|
|
|
<div className="unit">
|
2014-12-09 09:22:54 +01:00
|
|
|
<strong>{this.props.strategy.name} </strong>
|
2015-03-23 18:47:23 +01:00
|
|
|
<a href=""
|
|
|
|
title="Delete strategy"
|
|
|
|
onClick={this.onRemove}>(remove)</a><br />
|
2014-12-09 09:22:54 +01:00
|
|
|
<em>{this.props.strategy.description}</em><br />
|
2014-11-01 15:19:10 +01:00
|
|
|
</div>
|
2014-11-01 15:53:14 +01:00
|
|
|
</div>
|
|
|
|
);
|
2014-11-01 15:19:10 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-03-23 18:47:23 +01:00
|
|
|
module.exports = Strategy;
|