"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.PickerModalOpenButton = PickerModalOpenButton;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _designSystem = require("@wix/design-system");
var _react = _interopRequireDefault(require("react"));
var _TextWidthLoader = require("../TextWidthLoader");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/PickerModalOpenButton/PickerModalOpenButton.tsx";
function PickerModalOpenButton(props) {
  const {
    state,
    onMouseEnter,
    onClick,
    children,
    ...rest
  } = props;
  const {
    openModalOrCTA,
    hover,
    showButtonLoadingIndication
  } = state;
  return /*#__PURE__*/_react.default.createElement(_designSystem.Button, (0, _extends2.default)({}, rest, {
    onMouseEnter: (...args) => {
      hover();
      onMouseEnter == null || onMouseEnter(...args);
    },
    onClick: event => {
      openModalOrCTA();
      onClick == null || onClick(event);
    },
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 22,
      columnNumber: 5
    }
  }), showButtonLoadingIndication ? /*#__PURE__*/_react.default.createElement(_TextWidthLoader.TextWidthLoader, {
    size: "tiny",
    text: children,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 34,
      columnNumber: 9
    }
  }) : children);
}
//# sourceMappingURL=PickerModalOpenButton.js.map