'use strict';

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

var React = require('react');

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

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

const ProgressBarColorTypes = {
  PRIMARY: 'progress-bar-color--primary',
  GRAY: 'progress-bar-color--gray'
};
const ProgressBar = _ref => {
  let {
    className = '',
    disabled = false,
    maxSize,
    currentSize = 0,
    colorType = ProgressBarColorTypes.PRIMARY
  } = _ref;
  const width = React.useMemo(() => {
    return `${currentSize / maxSize * 100}%`;
  }, [currentSize, maxSize]);
  return /*#__PURE__*/React__default["default"].createElement("div", {
    className: `sendbird-progress-bar ${className} ${colorType} ${disabled ? 'progress-bar--disabled' : ''}`
  }, /*#__PURE__*/React__default["default"].createElement("div", {
    className: "sendbird-progress-bar__fill",
    style: {
      width
    }
  }));
};

exports.ProgressBar = ProgressBar;
exports.ProgressBarColorTypes = ProgressBarColorTypes;
exports["default"] = ProgressBar;
//# sourceMappingURL=ProgressBar.js.map
