/* eslint-disable i18next/no-literal-string */ import React, { ErrorInfo } from 'react'; import { Button } from 'antd'; import { Icon } from 'UI'; class PlayerErrorBoundary extends React.Component { state = { hasError: false, error: '' }; constructor(props: any) { super(props); } componentDidCatch(error: Error, info: ErrorInfo) { this.setState({ hasError: true, error: error + info.componentStack, }); } render() { if (this.state.hasError) { return (

Something went wrong during player rendering.

{this.state.error}

); } return this.props.children; } } export default PlayerErrorBoundary;