import variables from 'modules/variables'; import { PureComponent } from 'react'; import { ErrorOutline } from '@mui/icons-material'; export default class ErrorBoundary extends PureComponent { constructor(props) { super(props); this.state = { error: false }; } static getDerivedStateFromError(error) { console.log(error); variables.stats.postEvent('modal', 'Error occurred'); return { error: true }; } render() { if (this.state.error) { return (

{variables.language.getMessage(variables.languagecode, 'modals.main.error_boundary.title')}

{variables.language.getMessage(variables.languagecode, 'modals.main.error_boundary.message')}

); } return this.props.children; } }