<?php
/**
 * Country routing list view template.
 *
 * Variables in scope (passed by Admin_Settings::render_routing_list_view()):
 *
 * @var string                                                             $add_url
 * @var \DonationRouter\Country_Routing_List_Table      $list_table
 *
 * @since   1.0.0
 * @package DonationRouter
 */

declare( strict_types=1 );

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

?>
<div class="ador-list-header">
	<a href="<?php echo esc_url( $add_url ); ?>" class="page-title-action">
		<?php esc_html_e( 'Add New Routing Rule', 'alamin-donation-router' ); ?>
	</a>
</div>

<form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
	<?php wp_nonce_field( 'ador_bulk_deactivate_routings', 'ador_bulk_nonce' ); ?>
	<?php $list_table->display(); ?>
	<?php
	/*
	 * Printed AFTER the table on purpose: WP_List_Table::display() emits its own
	 * bulk <select name="action">, and admin-post.php dispatches on
	 * $_REQUEST['action'] (last duplicate key wins). See the accounts list template
	 * for the full rationale.
	 */
	?>
	<input type="hidden" name="action" value="ador_bulk_deactivate_routings" />
</form>
