1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/public/js/components/strategy/Strategy.jsx

32 lines
898 B
React
Raw Normal View History

var React = require('react');
var Strategy = React.createClass({
propTypes: {
strategy: React.PropTypes.object.isRequired
},
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);
}
},
render: function() {
return (
<div className="line mal">
<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 />
</div>
</div>
);
}
});
2015-03-23 18:47:23 +01:00
module.exports = Strategy;