'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var React = require('react');
var ui_Label = require('../index-35633fb6.js');
require('prop-types');
require('../stringSet-ce782136.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

let ButtonTypes$1 = /*#__PURE__*/function (ButtonTypes) {
  ButtonTypes["PRIMARY"] = "PRIMARY";
  ButtonTypes["SECONDARY"] = "SECONDARY";
  ButtonTypes["DANGER"] = "DANGER";
  ButtonTypes["DISABLED"] = "DISABLED";
  return ButtonTypes;
}({});
let ButtonSizes$1 = /*#__PURE__*/function (ButtonSizes) {
  ButtonSizes["BIG"] = "BIG";
  ButtonSizes["SMALL"] = "SMALL";
  return ButtonSizes;
}({});

function changeTypeToClassName(type) {
  switch (type) {
    case ButtonTypes$1.PRIMARY:
      return 'sendbird-button--primary';
    case ButtonTypes$1.SECONDARY:
      return 'sendbird-button--secondary';
    case ButtonTypes$1.DANGER:
      return 'sendbird-button--danger';
    case ButtonTypes$1.DISABLED:
      return 'sendbird-button--disabled';
    default:
      return null;
  }
}
function changeSizeToClassName(size) {
  switch (size) {
    case ButtonSizes$1.BIG:
      return 'sendbird-button--big';
    case ButtonSizes$1.SMALL:
      return 'sendbird-button--small';
    default:
      return null;
  }
}

const ButtonTypes = ButtonTypes$1;
const ButtonSizes = ButtonSizes$1;
function Button(_ref) {
  let {
    className,
    type = ButtonTypes.PRIMARY,
    size = ButtonSizes.BIG,
    children = 'Button',
    disabled = false,
    onClick = () => {/* noop */}
  } = _ref;
  const injectingClassNames = [...(Array.isArray(className) ? className : [className]), 'sendbird-button', disabled ? 'sendbird-button__disabled' : '', changeTypeToClassName(type), changeSizeToClassName(size)].join(' ');
  return /*#__PURE__*/React__default["default"].createElement("button", {
    className: injectingClassNames,
    type: "button",
    onClick: onClick,
    disabled: disabled
  }, /*#__PURE__*/React__default["default"].createElement(ui_Label.Label, {
    className: "sendbird-button__text",
    type: ui_Label.LabelTypography.BUTTON_1,
    color: ui_Label.LabelColors.ONCONTENT_1
  }, children));
}

exports.ButtonSizes = ButtonSizes;
exports.ButtonTypes = ButtonTypes;
exports["default"] = Button;
//# sourceMappingURL=Button.js.map
