var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/ecocup/cupList/hooks/useSummary.tsx
var useSummary_exports = {};
__export(useSummary_exports, {
  useSummary: () => useSummary
});
module.exports = __toCommonJS(useSummary_exports);
var import_react = __toESM(require("react"));
var import_materials = require("@pisell/materials");
var import__ = require("../index.less");
var prefixCls = "ecocup-cup-list";
var useSummary = (locales, staticsData, isPartner) => {
  const summaryData = (0, import_react.useMemo)(() => {
    return [
      {
        key: "cup-rent",
        title: isPartner ? locales.getText("pisell2.text.ecocup.cup-rent") : locales.getText("pisell2.text.ecocup.eco.cup-rent"),
        value: (staticsData == null ? void 0 : staticsData.rent_count) || 0,
        type: "primary"
      },
      {
        key: "cup-returned",
        title: isPartner ? locales.getText("pisell2.text.ecocup.cup-returned") : locales.getText("pisell2.text.ecocup.eco.cup-returned"),
        value: (staticsData == null ? void 0 : staticsData.return_count) || 0,
        type: "primary"
      },
      {
        key: "available-to-rent",
        title: locales.getText("pisell2.text.ecocup.available-to-rent"),
        value: (staticsData == null ? void 0 : staticsData.in_stock_count) || 0
      }
    ];
  }, [staticsData, isPartner]);
  return (0, import_react.useMemo)(() => {
    return () => /* @__PURE__ */ import_react.default.createElement(import_materials.Row, { gutter: 8, className: `${prefixCls}-summary` }, summaryData.map((item) => {
      return /* @__PURE__ */ import_react.default.createElement(import_materials.Col, { span: 8, key: item.key }, /* @__PURE__ */ import_react.default.createElement(
        import_materials.Card,
        {
          className: `${prefixCls}-summary-card ${(item == null ? void 0 : item.type) === "primary" ? `${prefixCls}-summary-primary` : ""}`
        },
        /* @__PURE__ */ import_react.default.createElement(
          import_materials.Statistic,
          {
            title: item.title,
            value: item.value,
            className: `${prefixCls}-summary-card-statistic`
          }
        )
      ));
    }));
  }, [summaryData]);
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  useSummary
});
