import { DangerIcon as m } from "./accelbyte-widgets328.mjs";
import { HelpIcon as o } from "./accelbyte-widgets329.mjs";
import { InfoIcon as i } from "./accelbyte-widgets330.mjs";
import { AlertType as t } from "./accelbyte-widgets128.mjs";
import p from "classnames";
import e from "react";
import { X as u, AlertCircle as f, CheckCircle as E } from "react-feather";
import r from "./accelbyte-widgets439.mjs";
class d extends e.Component {
  constructor(n) {
    super(n);
  }
  render() {
    const { className: n, children: c, type: l, onDismiss: a } = this.props;
    return /* @__PURE__ */ e.createElement("div", { className: p(r.floatingAlert, n, l && r[l]), role: "alert" }, /* @__PURE__ */ e.createElement("div", { className: r.messageContainer }, /* @__PURE__ */ e.createElement("span", { className: r.icon }, g(l)), /* @__PURE__ */ e.createElement("span", { className: r.message }, c)), !!a && /* @__PURE__ */ e.createElement(
      "span",
      {
        className: r.close,
        onClick: () => {
          a && a();
        }
      },
      /* @__PURE__ */ e.createElement(u, { size: "1em" })
    ));
  }
}
d.defaultProps = {};
function g(s) {
  switch (s) {
    case t.success:
      return /* @__PURE__ */ e.createElement(E, null);
    case t.danger:
      return /* @__PURE__ */ e.createElement(m, null);
    case t.warning:
      return /* @__PURE__ */ e.createElement(f, null);
    case t.info:
      return /* @__PURE__ */ e.createElement(i, null);
    case t.help:
      return /* @__PURE__ */ e.createElement(o, null);
    default:
      return null;
  }
}
export {
  d as FloatingAlert,
  g as getAlertIcon
};
