"use client"; import * as React from 'react'; import { ErrorInfo, ReactNode } from 'react'; import { AlertTriangle, RefreshCcw } from 'lucide-react'; interface Props { children: ReactNode; } interface State { hasError: boolean; error: Error | null; } export class ErrorBoundary extends React.Component { public state: State; constructor(props: Props) { super(props); this.state = { hasError: false, error: null }; } public static getDerivedStateFromError(error: Error): State { return { hasError: true, error }; } public override componentDidCatch(error: Error, errorInfo: ErrorInfo) { console.error('Uncaught error:', error, errorInfo); } private handleRetry = () => { this.setState({ hasError: false, error: null }); window.location.reload(); }; public override render(): ReactNode { if (this.state.hasError) { return (

متأسفانه خطایی رخ داده است

مشکلی در بارگذاری این بخش پیش آمده است. لطفاً برای ادامه دوباره تلاش کنید.

C
Canina Pharma Support
); } return this.props.children; } }