import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
import React__default, { forwardRef } from 'react';
import { IconPlus } from '../../../_Icon/Icons/IconPlus.js';
import { StyledIconButton } from '../../ui/IconButton/IconButton.styles.js';
import { StyledButton } from '../../ui/Button/Button.styles.js';

var _excluded = ["size", "icon"],
  _excluded2 = ["text"];
var getDefaultIcon = function getDefaultIcon(size) {
  var iconSize = size === 'xs' ? 'xs' : 's';
  return /*#__PURE__*/React__default.createElement(IconPlus, {
    size: iconSize,
    color: "inherit"
  });
};
var AttachButton = /*#__PURE__*/forwardRef(function (props, ref) {
  if (props.buttonType === 'iconButton') {
    var size = props.size,
      icon = props.icon,
      _rest = _objectWithoutProperties(props, _excluded);
    return /*#__PURE__*/React__default.createElement(StyledIconButton, _extends({
      ref: ref
    }, _rest), icon || getDefaultIcon(size));
  }
  var _props$text = props.text,
    text = _props$text === void 0 ? 'Загрузить файл' : _props$text,
    rest = _objectWithoutProperties(props, _excluded2);
  return /*#__PURE__*/React__default.createElement(StyledButton, _extends({
    ref: ref,
    text: text
  }, rest));
});

export { AttachButton };
