"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

// Style

/* istanbul ignore next */
if (typeof window !== 'undefined') require("./style.scss");

var Method = function Method(_ref) {
  var type = _ref.type,
      width = _ref.width,
      className = _ref.className,
      attrs = (0, _objectWithoutProperties2["default"])(_ref, ["type", "width", "className"]);
  return /*#__PURE__*/_react["default"].createElement("span", (0, _extends2["default"])({}, attrs, {
    className: ["Method Method_".concat(type), className || ''].join(' '),
    style: {
      width: width
    }
  }), type === 'options' ? 'optns' : type);
};

Method.propTypes = {
  className: _propTypes["default"].string,
  type: _propTypes["default"].oneOf(['basic', 'delete', 'fn', 'get', 'link', 'options', 'patch', 'post', 'put']).isRequired,
  width: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string])
};
Method.defaultProps = {
  width: 'auto'
};
var _default = Method;
exports["default"] = _default;