"use client"; import { Component, type ReactNode } from "react"; import { GlassCard } from "@/components/glass/card"; import { AlertCircle, RefreshCw } from "lucide-react"; interface Props { children: ReactNode; fallback?: ReactNode; } interface State { hasError: boolean; error?: Error; } export class ErrorBoundary extends Component { state: State = { hasError: false }; static getDerivedStateFromError(error: Error): State { return { hasError: true, error }; } render() { if (this.state.hasError) { return this.props.fallback || (

{this.state.error?.message || "Something went wrong"}

); } return this.props.children; } }