import React , { Suspense , ComponentType , ReactElement , Ref } from 'react' ; import { EuiLoadingSpinner , EuiErrorBoundary } from '@elastic/eui' ; param Component param fallback export const withSuspense = < P extends { } , R = { } > ( Component , fallback = < EuiLoadingSpinner />) => React.forwardRef((props, ref) => { return ( < EuiErrorBoundary > < Suspense fallback = { fallback } > < Component { ... props } ref = { ref } / > < /Suspense> < /EuiErrorBoundary>); } ) ; export const LazyReplacementCard = React . lazy ( ( ) => import ( './replacement_card' ) ) ;