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/list/components/EmptyState/EmptyState.tsx
var EmptyState_exports = {};
__export(EmptyState_exports, {
  default: () => EmptyState_default
});
module.exports = __toCommonJS(EmptyState_exports);
var import_react = __toESM(require("react"));
var import_materials = require("@pisell/materials");
var import_locales = __toESM(require("../../locales"));
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
var import_EmptyState = require("./EmptyState.less");
var EmptyState = ({
  config = { show: true, text: "", icon: null, description: "" },
  hasData = false
}) => {
  const context = (0, import_useEngineContext.default)();
  const getCurrentLanguage = () => {
    var _a, _b, _c, _d, _e, _f, _g, _h, _i;
    const appLocale = (_f = (_e = (_d = (_c = (_b = (_a = context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.getApp) == null ? void 0 : _c.call(_b)) == null ? void 0 : _d.locales) == null ? void 0 : _e.getLocale) == null ? void 0 : _f.call(_e);
    const storageLocale = (_i = (_h = (_g = context.appHelper) == null ? void 0 : _g.utils) == null ? void 0 : _h.storage) == null ? void 0 : _i.get("umi_locale");
    let finalLang = appLocale || storageLocale;
    if (!finalLang && typeof window !== "undefined") {
      finalLang = localStorage.getItem("umi_locale");
    }
    return finalLang || "en";
  };
  const getLocalText = (key, fallback) => {
    var _a;
    const currentLang = getCurrentLanguage();
    const localText = (_a = import_locales.default[currentLang]) == null ? void 0 : _a[key];
    if (typeof localText === "string") {
      return localText;
    }
    return fallback || "";
  };
  const displayText = config.text || getLocalText("pisell-list-empty-text-default", "No data available");
  if (!(config == null ? void 0 : config.show) || hasData) return null;
  const defaultIcon = /* @__PURE__ */ import_react.default.createElement("div", { className: "empty-icon-wrapper" }, /* @__PURE__ */ import_react.default.createElement(
    import_materials.Iconfont,
    {
      type: "pisell2-inbox-01",
      className: "empty-default-icon"
    }
  ));
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-list-empty-state" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "empty-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "empty-inner" }, config.icon || defaultIcon, /* @__PURE__ */ import_react.default.createElement("div", { className: "empty-text" }, displayText), config.description && /* @__PURE__ */ import_react.default.createElement("div", { className: "empty-description" }, config.description))));
};
var EmptyState_default = EmptyState;
