function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

import React from 'react';
import cx from 'classnames';
import { ReactSVG } from 'react-svg';

var Illustration = function Illustration(_ref) {
  var src = _ref.src,
      rest = _objectWithoutPropertiesLoose(_ref, ["src"]);

  var classes = cx('illustration', src.match(/.svg$/g) && 'center');
  var Tag = src.match(/.svg$/g) ? ReactSVG : 'img';
  return /*#__PURE__*/React.createElement("div", _extends({
    className: classes
  }, rest), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Tag, {
    src: src,
    alt: ""
  })));
};

Illustration.displayName = 'Illustration';
var IllustrationDoc;

if (process.env.NODE_ENV !== 'production') {
  // eslint-disable-next-line global-require
  IllustrationDoc = require('./doc').doc(Illustration);
}

var IllustrationWrapper = IllustrationDoc || Illustration;
export { IllustrationWrapper as Illustration };