"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.CustomColumnsAddCustomFieldCTAButton = CustomColumnsAddCustomFieldCTAButton;
var _react = _interopRequireDefault(require("react"));
var _ToolbarCollectionContext = require("../ToolbarCollectionContext");
var _AddCustomFieldCTAButton = require("./AddCustomFieldCTAButton");
var _designSystem = require("@wix/design-system");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/CustomFieldsPanel/CustomColumnsAddCustomFieldCTAButton.tsx";
function CustomColumnsAddCustomFieldCTAButton() {
  var _toolbar$collectionDa;
  const toolbar = (0, _ToolbarCollectionContext.useToolbarCollectionContext)();
  const state = (_toolbar$collectionDa = toolbar.collectionDataExtension) == null ? void 0 : _toolbar$collectionDa.customFieldsPanel;
  if (!state) {
    return null;
  }
  return /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
    direction: "vertical",
    width: "100%",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 15,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.Divider, {
    direction: "horizontal",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 16,
      columnNumber: 7
    }
  }), /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
    padding: "SP4",
    width: "100%",
    boxSizing: "border-box",
    direction: "vertical",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 17,
      columnNumber: 7
    }
  }, /*#__PURE__*/_react.default.createElement(_AddCustomFieldCTAButton.AddCustomFieldCTAButton, {
    dataHook: "custom-columns-data-extension-add-new",
    state: state,
    onClick: () => {
      state.openCustomFieldModal({
        origin: 'Custom columns panel'
      });
    },
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 23,
      columnNumber: 9
    }
  })));
}
//# sourceMappingURL=CustomColumnsAddCustomFieldCTAButton.js.map