import { H as m, I as d, D as u } from "./InfoIcon-c86fd057.mjs";
import { A as a } from "./Alert-1277e378.mjs";
import g from "classnames";
import e from "react";
import { X as p, AlertCircle as f, CheckCircle as h } from "react-feather";
import { B as v, a as w, b as E } from "./useRoutes-367960a3.mjs";
const N = "alert _alert_db1ce", b = "messageContainer _messageContainer_bce7f", B = "icon _icon_90bcc", C = "close _close_ba42b", k = "success _success_f5534", y = "danger _danger_1b97e", A = "info _info_31404", I = "warning _warning_dfd52", D = "help _help_55777", T = "withoutBackground _withoutBackground_7ab07", q = "message _message_d961e", s = {
  alert: N,
  messageContainer: b,
  icon: B,
  close: C,
  success: k,
  danger: y,
  info: A,
  warning: I,
  help: D,
  withoutBackground: T,
  message: q
};
class l extends e.Component {
  render() {
    const { className: _, children: n, type: t, onDismiss: c, dataQa: o = null, dismissDataQa: i = null } = this.props;
    return /* @__PURE__ */ e.createElement("div", { className: g(s.alert, _, t && s[t]), role: "alert", "data-qa-id": o }, /* @__PURE__ */ e.createElement("div", { className: s.messageContainer }, /* @__PURE__ */ e.createElement("span", { className: s.icon }, x(t)), /* @__PURE__ */ e.createElement("span", { className: s.message }, typeof n == "function" ? n() : n)), !!c && /* @__PURE__ */ e.createElement(
      v,
      {
        className: s.close,
        "data-qa-id": i,
        buttonStyle: w.NONE,
        buttonType: E.PLAIN,
        onClick: () => {
          c && c();
        }
      },
      /* @__PURE__ */ e.createElement(p, { size: "1em" })
    ));
  }
}
l.defaultProps = {};
l.className = {
  withoutBackground: s.withoutBackground
};
function x(r) {
  switch (r) {
    case a.success:
      return /* @__PURE__ */ e.createElement(h, null);
    case a.danger:
      return /* @__PURE__ */ e.createElement(u, null);
    case a.warning:
      return /* @__PURE__ */ e.createElement(f, null);
    case a.info:
      return /* @__PURE__ */ e.createElement(d, null);
    case a.help:
      return /* @__PURE__ */ e.createElement(m, null);
    default:
      return null;
  }
}
export {
  l as A,
  x as g
};
