import { DangerIcon as u } from "./accelbyte-widgets328.mjs";
import { HelpIcon as p } from "./accelbyte-widgets329.mjs";
import { InfoIcon as f } from "./accelbyte-widgets330.mjs";
import { AlertType as r } from "./accelbyte-widgets128.mjs";
import d from "classnames";
import e from "react";
import { X as E, AlertCircle as N, CheckCircle as g } from "react-feather";
import { Button as y, ButtonStyle as h, ButtonType as C } from "./accelbyte-widgets107.mjs";
import t from "./accelbyte-widgets331.mjs";
class o extends e.Component {
  render() {
    const { className: c, children: a, type: n, onDismiss: l, dataQa: m = null, dismissDataQa: i = null } = this.props;
    return /* @__PURE__ */ e.createElement("div", { className: d(t.alert, c, n && t[n]), role: "alert", "data-qa-id": m }, /* @__PURE__ */ e.createElement("div", { className: t.messageContainer }, /* @__PURE__ */ e.createElement("span", { className: t.icon }, I(n)), /* @__PURE__ */ e.createElement("span", { className: t.message }, typeof a == "function" ? a() : a)), !!l && /* @__PURE__ */ e.createElement(
      y,
      {
        className: t.close,
        "data-qa-id": i,
        buttonStyle: h.NONE,
        buttonType: C.PLAIN,
        onClick: () => {
          l && l();
        }
      },
      /* @__PURE__ */ e.createElement(E, { size: "1em" })
    ));
  }
}
o.defaultProps = {};
o.className = {
  withoutBackground: t.withoutBackground
};
function I(s) {
  switch (s) {
    case r.success:
      return /* @__PURE__ */ e.createElement(g, null);
    case r.danger:
      return /* @__PURE__ */ e.createElement(u, null);
    case r.warning:
      return /* @__PURE__ */ e.createElement(N, null);
    case r.info:
      return /* @__PURE__ */ e.createElement(f, null);
    case r.help:
      return /* @__PURE__ */ e.createElement(p, null);
    default:
      return null;
  }
}
export {
  o as Alert,
  I as getAlertIcon
};
