"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.CustomColumnsEditCustomFieldCTAButton = CustomColumnsEditCustomFieldCTAButton;
var _react = _interopRequireDefault(require("react"));
var _ToolbarCollectionContext = require("../ToolbarCollectionContext");
var _designSystem = require("@wix/design-system");
var _ManageFieldsPopoverMenu = require("./ManageFieldsPopoverMenu");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/CustomFieldsPanel/CustomColumnsEditCustomFieldCTAButton.tsx";
function CustomColumnsEditCustomFieldCTAButton({
  field
}) {
  var _toolbar$collectionDa;
  const toolbar = (0, _ToolbarCollectionContext.useToolbarCollectionContext)();
  const state = (_toolbar$collectionDa = toolbar.collectionDataExtension) == null ? void 0 : _toolbar$collectionDa.customFieldsPanel;
  if (!state || state.dataExtension.disableUserDefinedWriting) {
    return null;
  }
  return /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 19,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_ManageFieldsPopoverMenu.ManageFieldsPopoverMenu, {
    state: state,
    id: field.id,
    origin: "Custom columns panel",
    location: "Customize columns action cell",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 20,
      columnNumber: 7
    }
  }));
}
//# sourceMappingURL=CustomColumnsEditCustomFieldCTAButton.js.map