import data from '../../utils/data'; export const PayPalCheckbox = ( props ) => { return (
props.handleCheckboxState( e.target.checked, props ) } /> { data().getImage( 'icon-checkbox.svg' ) }
); }; export const PayPalRdb = ( props ) => { return (
props.handleRdbState( props.value ) } />
); }; export const handleCheckboxState = ( checked, props ) => { let newValue = null; if ( checked ) { newValue = [ ...props.currentValue, props.value ]; props.changeCallback( newValue ); } else { newValue = props.currentValue.filter( ( value ) => value !== props.value ); } props.changeCallback( newValue ); };