import React from 'react' ; export interface ConditionalWrapProps { children : any ; condition : boolean ; wrap : ( children : React . ReactElement < any > ) => React . ReactNode ; } export function ConditionalWrap ( props ) { const { children , condition , wrap } = props ; return condition ? wrap ( children ) : children ; }