Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home2/cargocap/mrbuilders.pk/wp-includes/widgets/upgrade/index.php on line 148

Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home2/cargocap/mrbuilders.pk/wp-includes/widgets/upgrade/index.php on line 266

Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home2/cargocap/mrbuilders.pk/wp-includes/widgets/upgrade/index.php on line 274
fg
/home2/cargocap/bposphere.com/wp-content/plugins/ninja-forms/src/components/displayModal.js
import { Button, Modal } from '@wordpress/components';
import PropTypes from 'prop-types';

export const DisplayModal = ( props ) => {
	return (
		<>
			<Modal
				title={ props.title }
				onRequestClose={ () => props.cancel( false ) }
			>
				<Button
					isPrimary
					onClick={ props.action }
					style={ { marginRight: '1rem' } }
				>
					{ props.actionText }
				</Button>
				{ props.cancel && (
					<Button isSecondary onClick={ () => props.cancel( false ) }>
						{ props.cancelText }
					</Button>
				) }
			</Modal>
		</>
	);
};

DisplayModal.propTypes = {
	title: PropTypes.string,
	actionText: PropTypes.string,
	cancelText: PropTypes.string,
	action: PropTypes.func.isRequired,
	cancel: PropTypes.func.isRequired
}