import React from "react"; import { AlertTriangle, RotateCcw } from "lucide-react"; import { Button } from "./ui/Button"; class ErrorBoundary extends React.Component { constructor(props) { super(props); this.state = { hasError: false, error: null }; } static getDerivedStateFromError(error) { return { hasError: true, error }; } componentDidCatch(error, errorInfo) { console.error("ErrorBoundary caught an error:", error, errorInfo); } render() { if (this.state.hasError) { return (
An unexpected error occurred in this section of the application. If this persists, please try refreshing the page.