import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import _extends from "@babel/runtime/helpers/extends";
import React, { Component, useEffect, useState } from "react";
var ImageInner = function ImageInner(props) {
  var _useState = useState(props.src),
    newSrc = _useState[0],
    setNewSrc = _useState[1];
  useEffect(function () {
    setNewSrc(props.src);
  }, [props.src]);
  var handleError = function handleError() {
    setNewSrc(props.fallback || "https://d3r48att5ocy3q.cloudfront.net/p/240626/fe4b1a63ae0e40fb90a0cc36fc465093.png");
  };
  return /*#__PURE__*/React.createElement("img", _extends({}, props, {
    src: newSrc,
    onError: handleError
  }));
};
var _default = /*#__PURE__*/function (_Component) {
  function _default() {
    return _Component.apply(this, arguments) || this;
  }
  _inheritsLoose(_default, _Component);
  var _proto = _default.prototype;
  _proto.render = function render() {
    return /*#__PURE__*/React.createElement(ImageInner, _extends({
      className: "imageInner"
    }, this.props));
  };
  return _default;
}(Component);
export { _default as default };