import React , { cloneElement } from 'react' ; import { Text } from 'react-native' ; import type { ButtonContentProps } from './types' ; const ButtonContent = ( { style , children : Children } ) => { if ( Children === null || Children === undefined ) { return null ; } if ( typeof Children === 'function' ) { return Children ( { style } ) ; } if ( typeof Children === 'object' ) { return cloneElement ( Children , { ... Children . props , style : [ style , Children . props . style ] , } ) ; } if ( typeof Children === 'string' ) { return < Text style = { style } > { Children } < /Text>; } return null ; } ; export default ButtonContent ;