"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.TagsAssignButton = void 0;
var _react = _interopRequireDefault(require("react"));
var _designSystem = require("@wix/design-system");
var _wixUiIconsCommon = require("@wix/wix-ui-icons-common");
var _ToolbarCollectionContext = require("../ToolbarCollectionContext");
var _ = require("../..");
var _BulkAssignTagsPopover = require("../Tags/BulkAssignTagsPopover");
var _DisabledTooltip = require("../DisabledTooltip");
var _mobxReactLite = require("mobx-react-lite");
var _jsxFileName = "/home/builduser/work/db7ea24852bc3350/packages/cairo/dist/cjs/components/TagsAssignButton/TagsAssignButton.tsx";
const _TagsAssignButton = () => {
  const toolbarCollectionState = (0, _ToolbarCollectionContext.useToolbarCollectionContext)();
  const {
    translate: t
  } = (0, _.useWixPatternsContainer)();
  const {
    tagsBulkAssignPopoverState
  } = toolbarCollectionState.tagsCollectionState ?? {};
  if (!tagsBulkAssignPopoverState) {
    return null;
  }
  const {
    tagsBulkAssignButtonState
  } = tagsBulkAssignPopoverState;
  return /*#__PURE__*/_react.default.createElement(_BulkAssignTagsPopover.BulkAssignTagsPopover, {
    state: tagsBulkAssignPopoverState,
    popoverElement: /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
      __self: void 0,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 27,
        columnNumber: 9
      }
    }, /*#__PURE__*/_react.default.createElement(_DisabledTooltip.DisabledTooltip, {
      content: tagsBulkAssignButtonState.tooltipContent,
      disabled: !tagsBulkAssignButtonState.isDisabled,
      dataHook: "tags-assign-button-disabled-tooltip",
      __self: void 0,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 28,
        columnNumber: 11
      }
    }, /*#__PURE__*/_react.default.createElement(_designSystem.Button, {
      skin: "standard",
      priority: "secondary",
      size: "small",
      ellipsis: true,
      prefixIcon: /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.TagSmall, {
        __self: void 0,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 38,
          columnNumber: 27
        }
      }),
      dataHook: "tags-assign-button",
      onClick: () => {
        tagsBulkAssignPopoverState.showPopover();
      },
      disabled: tagsBulkAssignButtonState.isDisabled,
      __self: void 0,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 33,
        columnNumber: 13
      }
    }, t('cairo.tags.collectionPage.add.CTA')))),
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 24,
      columnNumber: 5
    }
  });
};
const TagsAssignButton = exports.TagsAssignButton = (0, _mobxReactLite.observer)(_TagsAssignButton);
//# sourceMappingURL=TagsAssignButton.js.map