"use client"; import React, { Component } from "react"; class ErrorBoundary extends Component { constructor(props) { super(props); this.state = { hasError: false, error: null }; } static getDerivedStateFromError(error) { // Update state so the next render will show the fallback UI return { hasError: true, error }; } componentDidCatch(error, errorInfo) { // Log the error to an error reporting service console.error("ErrorBoundary caught an error:", error, errorInfo); } render() { if (this.state.hasError) { // Fallback UI using design tokens return (
We're sorry, but something unexpected happened.