import e from "react";
import { Link as c } from "react-router-dom";
import { Icons as l } from "./Icons/Icons.js";
import "./Icons/EuiIcon.js";
import "@elastic/eui";
const u = ({ onClick: n, link: o, label: m, icon: t, className: a, type: r, onCloseModal: s }) => {
  if (o && typeof o == "string")
    return /* @__PURE__ */ e.createElement(c, {
      to: o
    }, /* @__PURE__ */ e.createElement("button", {
      type: r || "button",
      className: "inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-600 hover:text-green-600 hover:border-green-600 " + a
    }, t && /* @__PURE__ */ e.createElement(l, {
      name: t,
      className: "inline-flex w-5 h-5 mr-1 opacity-75 "
    }), m));
  const i = (f) => n && typeof n == "string" ? n === "closeModal" ? s() : console.log("onClick string") : n && n(f);
  return /* @__PURE__ */ e.createElement("button", {
    type: r || "button",
    onClick: i,
    className: "inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-600 hover:text-green-600 hover:border-green-600 " + a
  }, t && /* @__PURE__ */ e.createElement(l, {
    name: t,
    className: "inline-flex w-5 h-5 mr-1 opacity-75"
  }), m);
}, b = ({ data: n, onCloseModal: o }) => {
  let m = [], t = [], a = [];
  return n.map((r, s) => {
    if (r.layout === "left") {
      t.push(
        /* @__PURE__ */ e.createElement(u, {
          key: s,
          ...r,
          onCloseModal: o
        })
      );
      return;
    }
    if (r.layout === "right") {
      a.push(
        /* @__PURE__ */ e.createElement(u, {
          key: s,
          ...r,
          onCloseModal: o
        })
      );
      return;
    }
    m.push(
      /* @__PURE__ */ e.createElement(u, {
        key: s,
        ...r,
        onCloseModal: o
      })
    );
  }), /* @__PURE__ */ e.createElement("div", {
    className: `flex mt-6 ${t.length !== 0 || a.length !== 0 ? "justify-between" : ""}`
  }, /* @__PURE__ */ e.createElement("div", null, t), /* @__PURE__ */ e.createElement("div", {
    className: "ml-28"
  }, m), /* @__PURE__ */ e.createElement("div", null, a));
};
export {
  u as Button,
  b as Buttons
};
//# sourceMappingURL=Button.js.map
