import React from 'react';
export default (DecoratorParent, childComponent)=>{

    let componentDecorated=childComponent;
    if(typeof DecoratorParent === "function"){
        componentDecorated = DecoratorParent(childComponent);
    }
    else if(DecoratorParent){
        componentDecorated = <DecoratorParent>{childComponent}</DecoratorParent>
    }

    return componentDecorated;
}
