var __assign = this && this.__assign || function () {
  __assign = Object.assign || function (t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];

      for (var p in s) {
        if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
      }
    }

    return t;
  };

  return __assign.apply(this, arguments);
};

import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { IconButton } from "../../../button";
import * as React from 'react';
import AnalysisBtn from "../AnalysisBtn";
var prefixCls = "dmc-global-filter-tf";
var TiledFilterFooter = /*#__PURE__*/React.memo(function (_a) {
  var startAnalysisProps = _a.startAnalysisProps,
      isOpen = _a.isOpen,
      changeOpen = _a.changeOpen,
      startAnalysis = _a.startAnalysis,
      isNeedMore = _a.isNeedMore,
      textLabels = _a.textLabels,
      clearFilter = _a.clearFilter;
  var moreNode = React.useMemo(function () {
    return isNeedMore && _jsx("div", __assign({
      className: prefixCls + "-footer-label",
      onClick: changeOpen
    }, {
      children: !isOpen ? textLabels === null || textLabels === void 0 ? void 0 : textLabels.collapse : textLabels === null || textLabels === void 0 ? void 0 : textLabels.expand
    }), void 0);
  }, [isNeedMore, changeOpen, isOpen, textLabels === null || textLabels === void 0 ? void 0 : textLabels.collapse, textLabels === null || textLabels === void 0 ? void 0 : textLabels.expand]);
  return _jsxs("div", __assign({
    className: prefixCls + "-footer " + prefixCls + "-row"
  }, {
    children: [clearFilter && _jsx(IconButton, {
      icon: "reset",
      type: "only-icon",
      onClick: clearFilter
    }, void 0), moreNode, _jsx(AnalysisBtn, {
      className: prefixCls + "-analysis-button",
      startAnalysis: startAnalysis,
      startAnalysisProps: startAnalysisProps
    }, void 0)]
  }), void 0);
});
export default TiledFilterFooter;

