"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
require("react");
const classNames = require("../_util/classNames.js");
const useShowFooter = require("./utils/hooks/useShowFooter.js");
const index = require("../../icon/react-icon/IconMore/index.js");
const triggerForToolbar = require("./trigger-for-toolbar.js");
const emotionReactJsxRuntime_browser_esm = require("../../../../../../@emotion_react@11.10.4_3toe27fv7etiytxb5kxc7fxaw4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");
var __read = globalThis && globalThis.__read || function(o, n) {
  var m = typeof Symbol === "function" && o[Symbol.iterator];
  if (!m)
    return o;
  var i = m.call(o), r, ar = [], e;
  try {
    while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
      ar.push(r.value);
  } catch (error) {
    e = {
      error
    };
  } finally {
    try {
      if (r && !r.done && (m = i["return"]))
        m.call(i);
    } finally {
      if (e)
        throw e.error;
    }
  }
  return ar;
};
var ImageFooter = function(props) {
  var _a;
  var style = props.style, className = props.className, title = props.title, description = props.description, actions = props.actions, prefixCls = props.prefixCls, simple = props.simple;
  var _b = __read(useShowFooter({
    title,
    description,
    actions
  }), 3), showFooter = _b[0], showCaption = _b[1], showActions = _b[2];
  if (!showFooter)
    return null;
  var footerPrefixCls = prefixCls + "-footer";
  var classNames$1 = classNames(footerPrefixCls, className, (_a = {}, _a[footerPrefixCls + "-with-actions"] = showActions, _a));
  var renderActionList = function() {
    var actionsList = /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
      className: prefixCls + "-actions-list",
      children: actions.map(function(item, index2) {
        return /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
          className: prefixCls + "-actions-item",
          children: item
        }, "" + index2);
      })
    });
    if (simple) {
      return /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
        className: prefixCls + "-actions-list",
        children: /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx(triggerForToolbar.TriggerForToolbar, {
          prefixCls,
          popup: function() {
            return actionsList;
          },
          children: /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
            className: classNames(prefixCls + "-actions-item", prefixCls + "-actions-item-trigger"),
            children: /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("span", {
              children: /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx(index, {})
            })
          })
        })
      });
    }
    return actionsList;
  };
  return /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsxs("div", {
    className: classNames$1,
    style,
    children: [showCaption && /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsxs("div", {
      className: classNames(footerPrefixCls + "-block", prefixCls + "-caption"),
      children: [title && /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
        className: prefixCls + "-caption-title",
        title,
        children: title
      }), description && !simple && /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
        className: prefixCls + "-caption-description",
        title: description,
        children: description
      })]
    }), showActions && /* @__PURE__ */ emotionReactJsxRuntime_browser_esm.jsx("div", {
      className: classNames(footerPrefixCls + "-block", prefixCls + "-actions"),
      children: renderActionList()
    })]
  });
};
exports.ImageFooter = ImageFooter;
//# sourceMappingURL=image-footer.js.map
