ampache_react/app/components/elements/DismissibleAlert.jsx
Phyks (Lucas Verney) d8a7d4f66a Rework webplayer
Full rework of webplayer. Webplayer is back to its previous working
state, and ready for further improvements.
2016-08-10 23:50:23 +02:00

32 lines
846 B
JavaScript

// NPM imports
import React, { Component, PropTypes } from "react";
/**
* A dismissible Bootstrap alert.
*/
export default class DismissibleAlert extends Component {
render() {
// Set correct alert type
let alertType = "alert-danger";
if (this.props.type) {
alertType = "alert-" + this.props.type;
}
return (
<div className={["alert", alertType].join(" ")} role="alert">
<p>
<button type="button" className="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
{this.props.text}
</p>
</div>
);
}
}
DismissibleAlert.propTypes = {
type: PropTypes.string,
text: PropTypes.string,
};