import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; import type { ReactNode } from 'react'; import { Component } from 'react'; import tw from 'twin.macro'; import Icon from '@/components/elements/Icon'; interface Props { children?: ReactNode; } interface State { hasError: boolean; } class ErrorBoundary extends Component { override state: State = { hasError: false, }; static getDerivedStateFromError() { return { hasError: true }; } override componentDidCatch(error: Error) { console.error(error); } override render() { return this.state.hasError ? (

An error was encountered by the application while rendering this view. Try refreshing the page.

) : ( this.props.children ); } } export default ErrorBoundary;