import React, { ReactElement, Suspense } from 'react';

const withSuspense = (
    Component: React.ComponentType,
    fallback: ReactElement
) => (props: any) => (
    <Suspense fallback={fallback}>
        <Component {...props} />
    </Suspense>
);

export default withSuspense;
