import React__default from 'react';
import { withTranslation } from 'react-i18next';

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

export { ErrorBoundary$1 as default };
