import React from 'react'
import Spinner from "./spinner.component";
const WithSpinner = WrappedComponent =>  ({ defaultHeight = true, defaultSize, isLoading, ...otherProps}) => {
        
    return isLoading ? 
        (<Spinner defaultHeight={defaultHeight} defaultSize={defaultSize}/>)
    :
    <WrappedComponent {...otherProps}/>
    
}
    
    

export default WithSpinner