import React from 'react';
import type {IConditionalWrapper as Props} from './conditional-wrapper.type';

export const ConditionalWrapperComponent: React.FC<Props> = ({
    enable,
    wrapper,
    children,
}) => {
    if (enable && wrapper) return wrapper(children);
    return children;
};
