<?php
/**
 * Confirmation Modal.
 *
 * @package EaLab\WP_Deployer
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Confirmation Modal.
 *
 * @param string $title The title of the modal.
 * @param string $message The message of the modal.
 *
 * @return string Markup.
 */
function deploy_sync_content__confirmation_modal( string $title, string $message ): void {
	?>
	<div class="modal fade" id="confirmationModal" tabindex="-1" aria-labelledby="confirmationModalLabel" aria-hidden="true">
	    <div class="modal-dialog">
	        <div class="modal-content">
	        <div class="modal-header">
	            <h1 class="modal-title fs-5" id="confirmationModalLabel"><?php echo esc_attr( $title ?? '' ) ?></h1>
	            <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
	        </div>
	        <div class="modal-body">
	            <p><?php echo esc_attr( $message ?? '' ) ?></p>
	        </div>
	        <div class="modal-footer">
	            <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo esc_html__( 'Cancel', 'deploy-sync-content' ) ?></button>
	            <button type="button" class="btn btn-primary" id="confirm-action"><?php echo esc_html__( 'Confirm', 'deploy-sync-content' ) ?></button>
	        </div>
	        </div>
	    </div>
	</div>
	<?php
}
