"use strict";

exports.__esModule = true;
exports.useTagsBulkAssignFoldersUtils = useTagsBulkAssignFoldersUtils;
var _react = require("react");
var _TagsBulkAssignUtils = require("./TagsBulkAssignUtils");
function useTagsBulkAssignFoldersUtils({
  state
}) {
  var _state$toolbar$tagsCo;
  const {
    tagsBulkAssignButtonState
  } = ((_state$toolbar$tagsCo = state.toolbar.tagsCollectionState) == null ? void 0 : _state$toolbar$tagsCo.tagsBulkAssignPopoverState) ?? {};
  const {
    hasReachedMaxSelectedItems,
    isDuringApplyChanges
  } = (0, _TagsBulkAssignUtils.getBulkAssignStatus)({
    state: state.toolbar
  });
  (0, _react.useEffect)(() => {
    if (tagsBulkAssignButtonState) {
      const tooltipContent = (0, _TagsBulkAssignUtils.getDisabledTooltipContent)({
        state: state.toolbar,
        hasSelectedFolders: state.collections.hasSelectedFolders
      });
      tagsBulkAssignButtonState.setTooltipContent(tooltipContent);
    }
  }, [hasReachedMaxSelectedItems, isDuringApplyChanges, state.collections.hasSelectedFolders]);
}
//# sourceMappingURL=useTagsBulkAssignFoldersUtils.js.map