'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = BlobImage;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _ImageContainer = require('../../containers/media/ImageContainer');

var _ImageContainer2 = _interopRequireDefault(_ImageContainer);

var _blobHelpers = require('../../helpers/blobHelpers');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var propTypes = {
  csid: _propTypes2.default.string.isRequired,
  derivative: _propTypes2.default.string
};

var defaultProps = {
  derivative: 'Thumbnail'
};

function BlobImage(props) {
  var csid = props.csid,
      derivative = props.derivative;


  var path = (0, _blobHelpers.getDerivativePath)(csid, derivative);

  return (
    // TODO: Is there any alt text that would be helpful? Leaving it off for now.
    /* eslint-disable jsx-a11y/img-has-alt */
    _react2.default.createElement(_ImageContainer2.default, { src: path })
    /* eslint-enable jsx-a11y/img-has-alt */

  );
}

BlobImage.propTypes = propTypes;
BlobImage.defaultProps = defaultProps;