"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.TagsColumnContent = void 0;
var _designSystem = require("@wix/design-system");
var _ToolbarCollectionContext = require("../ToolbarCollectionContext");
var _react = _interopRequireDefault(require("react"));
var _mobxReactLite = require("mobx-react-lite");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/TagsColumn/TagsColumnContent.tsx";
function _TagsColumnContent({
  item
}) {
  var _tags$privateTags;
  const {
    tagsCollectionState
  } = (0, _ToolbarCollectionContext.useToolbarCollectionContext)();
  if (!(tagsCollectionState != null && tagsCollectionState.tagsManagementState)) {
    return null;
  }
  const tags = item.tags ?? (tagsCollectionState._getTags == null ? void 0 : tagsCollectionState._getTags(item));
  const tagNamesString = tags == null || (_tags$privateTags = tags.privateTags) == null || (_tags$privateTags = _tags$privateTags.tagIds) == null ? void 0 : _tags$privateTags.map(tagId => {
    var _tagsCollectionState$;
    return (_tagsCollectionState$ = tagsCollectionState.tagsManagementState.items.find(tag => tag.id === tagId)) == null ? void 0 : _tagsCollectionState$.name;
  }).filter(Boolean).join(', ');
  return /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
    minWidth: 0,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 28,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.Text, {
    size: "small",
    ellipsis: true,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 29,
      columnNumber: 7
    }
  }, tagNamesString));
}
const TagsColumnContent = exports.TagsColumnContent = (0, _mobxReactLite.observer)(_TagsColumnContent);
//# sourceMappingURL=TagsColumnContent.js.map