1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/packages/unleash-frontend/public/js/components/strategy/Strategy.jsx
2020-02-20 08:30:26 +01:00

32 lines
882 B
JavaScript

'use strict';
const React = require('react');
const Strategy = React.createClass({
propTypes: {
strategy: React.PropTypes.object.isRequired
},
onRemove(event) {
event.preventDefault();
if (window.confirm(`Are you sure you want to delete strategy '${this.props.strategy.name}'?`)) {
this.props.onRemove(this.props.strategy);
}
},
render() {
return (
<div className="line mal">
<div className="unit">
<strong>{this.props.strategy.name} </strong>
<a href=""
title="Delete strategy"
onClick={this.onRemove}>(remove)</a><br />
<em>{this.props.strategy.description}</em><br />
</div>
</div>
);
}
});
module.exports = Strategy;