mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
21 lines
479 B
React
21 lines
479 B
React
|
var React = require('react');
|
||
|
|
||
|
var ErrorMessages = React.createClass({
|
||
|
render: function() {
|
||
|
if (!this.props.errors.length) {
|
||
|
return <div/>;
|
||
|
}
|
||
|
|
||
|
var errorNodes = this.props.errors.map(function(e) {
|
||
|
return (<li key={e}>{e}</li>);
|
||
|
});
|
||
|
|
||
|
return (
|
||
|
<div className="alert alert-danger" role="alert">
|
||
|
<ul>{errorNodes}</ul>
|
||
|
</div>
|
||
|
);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
module.exports = ErrorMessages;
|