import { Component, type ReactNode } from 'react' import { Button } from '@/components/ui/button' interface Props { children: ReactNode } interface State { hasError: boolean } export class ErrorBoundary extends Component { state: State = { hasError: false } static getDerivedStateFromError(): State { return { hasError: true } } handleReload = () => { this.setState({ hasError: false }) window.location.reload() } render() { if (this.state.hasError) { return (

Something went wrong

) } return this.props.children } }