1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-01 00:08:27 +01:00
unleash.unleash/packages/unleash-frontend/public/js/components/strategy/Strategy.jsx

32 lines
882 B
React
Raw Normal View History

2016-06-18 21:53:18 +02:00
'use strict';
const React = require('react');
2016-06-18 21:53:18 +02:00
const Strategy = React.createClass({
propTypes: {
strategy: React.PropTypes.object.isRequired
},
2016-06-18 21:53:18 +02:00
onRemove(event) {
2014-12-09 09:22:54 +01:00
event.preventDefault();
2016-06-18 21:53:18 +02: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);
}
},
2016-06-18 21:53:18 +02:00
render() {
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;