'use strict';

var React = require('react');
var reactI18next = require('react-i18next');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

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

class ErrorBoundary extends React__default.default.Component {
  constructor(props) {
    super(props);
    this.state = { error: null };
  }
  static getDerivedStateFromError(error) {
    return { error };
  }
  render() {
    if (this.state.error) {
      return /* @__PURE__ */ React__default.default.createElement("div", { title: String(this.state.error) }, this.props.t("components.unknow_error"));
    }
    return this.props.children;
  }
}
var ErrorBoundary$1 = reactI18next.withTranslation()(ErrorBoundary);

module.exports = ErrorBoundary$1;
