"use strict";const r=require("./InfoIcon-57b0b7a1.js"),n=require("./Alert-dec85153.js"),p=require("classnames"),e=require("react"),_=require("react-feather"),l=require("./useRoutes-df841412.js"),f="alert _alert_db1ce",h="messageContainer _messageContainer_bce7f",v="icon _icon_90bcc",w="close _close_ba42b",y="success _success_f5534",A="danger _danger_1b97e",E="info _info_31404",N="warning _warning_dfd52",C="help _help_55777",b="withoutBackground _withoutBackground_7ab07",B="message _message_d961e",s={alert:f,messageContainer:h,icon:v,close:w,success:y,danger:A,info:E,warning:N,help:C,withoutBackground:b,message:B};class o extends e.Component{render(){const{className:u,children:t,type:a,onDismiss:c,dataQa:m=null,dismissDataQa:g=null}=this.props;return e.createElement("div",{className:p(s.alert,u,a&&s[a]),role:"alert","data-qa-id":m},e.createElement("div",{className:s.messageContainer},e.createElement("span",{className:s.icon},d(a)),e.createElement("span",{className:s.message},typeof t=="function"?t():t)),!!c&&e.createElement(l.Button,{className:s.close,"data-qa-id":g,buttonStyle:l.ButtonStyle.NONE,buttonType:l.ButtonType.PLAIN,onClick:()=>{c&&c()}},e.createElement(_.X,{size:"1em"})))}}o.defaultProps={};o.className={withoutBackground:s.withoutBackground};function d(i){switch(i){case n.AlertType.success:return e.createElement(_.CheckCircle,null);case n.AlertType.danger:return e.createElement(r.DangerIcon,null);case n.AlertType.warning:return e.createElement(_.AlertCircle,null);case n.AlertType.info:return e.createElement(r.InfoIcon,null);case n.AlertType.help:return e.createElement(r.HelpIcon,null);default:return null}}exports.Alert=o;exports.getAlertIcon=d;
