import React, { ReactNode } from 'react';
import ErrorBoundary from './ErrorBoundary';

interface ErrorBoundaryRouteProps {
  children: ReactNode;
  fallback?: ReactNode;
}

/**
 * Wrapper component that wraps a route with an ErrorBoundary
 * Use this for critical routes that need isolated error handling
 */
const ErrorBoundaryRoute: React.FC<ErrorBoundaryRouteProps> = ({ 
  children, 
  fallback 
}) => {
  return (
    <ErrorBoundary fallback={fallback}>
      {children}
    </ErrorBoundary>
  );
};

export default ErrorBoundaryRoute;

