import { EcomPath as c } from "./accelbyte-widgets59.mjs";
import i from "./accelbyte-widgets261.mjs";
import r from "classnames";
import e from "react";
import { Trans as n } from "react-i18next";
import { Link as p } from "react-router-dom";
import g from "./accelbyte-widgets422.mjs";
const I = ({ link: l, thumbnail: a, name: m, type: t, quantity: o }) => /* @__PURE__ */ e.createElement(p, { to: l, className: "catalogItem" }, /* @__PURE__ */ e.createElement("div", { className: "catalogItemImage" }, /* @__PURE__ */ e.createElement("img", { src: a || i, loading: "lazy" })), /* @__PURE__ */ e.createElement("div", { className: "catalogItemDetail" }, /* @__PURE__ */ e.createElement("div", { className: "catalogItemHeading" }, m), /* @__PURE__ */ e.createElement("div", { className: "catalogItemType" }, t), /* @__PURE__ */ e.createElement("div", { className: "catalogItemQty" }, o > 1 && `x${o}`)));
class f extends e.Component {
  constructor(a) {
    super(a);
  }
  render() {
    const { items: a, optionboxItem: m } = this.props;
    return /* @__PURE__ */ e.createElement("div", { className: r(g.catalogOptionboxItemList, "catalogOptionboxItemList") }, /* @__PURE__ */ e.createElement("h2", { className: "catalogHeading" }, /* @__PURE__ */ e.createElement(n, { i18nKey: "CatalogOptionboxItemList.heading" }, "Inside The Option Box")), a.length > 0 && /* @__PURE__ */ e.createElement("div", { className: "catalogList" }, a.map((t) => {
      const o = t.appType || t.itemType, s = t.thumbnailUrl || i;
      return /* @__PURE__ */ e.createElement(
        I,
        {
          key: t.itemId,
          link: c.getItemDetailRoute(t),
          thumbnail: s,
          name: t.title || t.name || "",
          type: o,
          quantity: m.itemQty ? m.itemQty[t.itemId] : 1
        }
      );
    })), a.length === 0 && /* @__PURE__ */ e.createElement("div", { className: "catalogNoItem" }, /* @__PURE__ */ e.createElement(n, { i18nKey: "CatalogOptionboxItemList.noItem" }, "Looks like there aren't any optionbox item yet.")));
  }
}
export {
  f as CatalogOptionboxItemList
};
