'use strict';

var tslib_es6 = require('./tslib.es6-ba69891c.js');
var React = require('react');
var ui_Label = require('./index-089e0fba.js');

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

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

exports.Type = void 0;

(function (Type) {
  Type[Type["PRIMARY"] = 0] = "PRIMARY";
  Type[Type["SECONDARY"] = 1] = "SECONDARY";
  Type[Type["DANGER"] = 2] = "DANGER";
  Type[Type["DISABLED"] = 3] = "DISABLED";
})(exports.Type || (exports.Type = {}));

var Size;

(function (Size) {
  Size[Size["BIG"] = 0] = "BIG";
  Size[Size["SMALL"] = 1] = "SMALL";
})(Size || (Size = {}));

function changeTypeToClassName(type) {
  switch (type) {
    case exports.Type.PRIMARY:
      return 'sendbird-button--primary';

    case exports.Type.SECONDARY:
      return 'sendbird-button--secondary';

    case exports.Type.DANGER:
      return 'sendbird-button--danger';

    case exports.Type.DISABLED:
      return 'sendbird-button--disabled';

    default:
      return null;
  }
}
function changeSizeToClassName(size) {
  switch (size) {
    case Size.BIG:
      return 'sendbird-button--big';

    case Size.SMALL:
      return 'sendbird-button--small';

    default:
      return null;
  }
}

function Button(_a) {
  var className = _a.className,
      _b = _a.type,
      type = _b === void 0 ? exports.Type.PRIMARY : _b,
      _c = _a.size,
      size = _c === void 0 ? Size.BIG : _c,
      _d = _a.children,
      children = _d === void 0 ? 'Button' : _d,
      _e = _a.disabled,
      disabled = _e === void 0 ? false : _e,
      _f = _a.onClick,
      onClick = _f === void 0 ? function () {} : _f;

  var injectingClassNames = tslib_es6.__spreadArray(tslib_es6.__spreadArray([], Array.isArray(className) ? className : [className], true), ['sendbird-button', disabled ? 'sendbird-button__disabled' : '', changeTypeToClassName(type), changeSizeToClassName(size)], false).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));
}
var ButtonTypes = exports.Type;
var ButtonSizes = Size;

exports.Button = Button;
exports.ButtonSizes = ButtonSizes;
exports.ButtonTypes = ButtonTypes;
//# sourceMappingURL=index-05692021.js.map
