function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';

var Avatar = function Avatar(_ref) {
  var _classNames;

  var size = _ref.size,
      imageUrl = _ref.imageUrl,
      isEmulating = _ref.isEmulating,
      testSection = _ref.testSection;
  var avatarClassNames = classNames('oui-avatar', (_classNames = {}, _defineProperty(_classNames, "oui-avatar--".concat(size), size), _defineProperty(_classNames, 'color-admin--border', isEmulating), _classNames));
  var avatarInlineStyles = imageUrl ? {
    backgroundImage: "url(".concat(imageUrl, ")")
  } : {};
  return React.createElement("div", {
    "data-test-section": testSection
  }, React.createElement("div", {
    className: avatarClassNames,
    style: avatarInlineStyles
  }));
};

Avatar.propTypes = {
  /**
   * Image to use for the avatar - default is the anonymous head
   */
  imageUrl: PropTypes.string,

  /**
   * Whether or not the emulating border should appear
   */
  isEmulating: PropTypes.bool,

  /**
   * Size of the avatar, large is default
   */
  size: PropTypes.oneOf(['small', 'medium']),

  /**
   * Data test section to use for testing
   */
  testSection: PropTypes.string
};
export default Avatar;