"use strict";const r=require("./InfoIcon-57b0b7a1.js"),s=require("./Alert-dec85153.js"),p=require("classnames"),e=require("react"),_=require("react-feather"),l=require("./Button-44f4db23.js"),h="alert _alert_e4894",f="messageContainer _messageContainer_27781",v="icon _icon_27ca0",w="close _close_ef105",y="success _success_c518e",A="danger _danger_02413",E="info _info_8919a",N="warning _warning_5e1aa",B="help _help_3a100",C="withoutBackground _withoutBackground_b7644",I="message _message_2dd2b",n={alert:h,messageContainer:f,icon:v,close:w,success:y,danger:A,info:E,warning:N,help:B,withoutBackground:C,message:I};class o extends e.Component{render(){const{className:d,children:t,type:a,onDismiss:c,dataQa:m=null,dismissDataQa:g=null}=this.props;return e.createElement("div",{className:p(n.alert,d,a&&n[a]),role:"alert","data-qa-id":m},e.createElement("div",{className:n.messageContainer},e.createElement("span",{className:n.icon},u(a)),e.createElement("span",{className:n.message},typeof t=="function"?t():t)),!!c&&e.createElement(l.Button,{className:n.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:n.withoutBackground};function u(i){switch(i){case s.AlertType.success:return e.createElement(_.CheckCircle,null);case s.AlertType.danger:return e.createElement(r.DangerIcon,null);case s.AlertType.warning:return e.createElement(_.AlertCircle,null);case s.AlertType.info:return e.createElement(r.InfoIcon,null);case s.AlertType.help:return e.createElement(r.HelpIcon,null);default:return null}}exports.Alert=o;exports.getAlertIcon=u;
