<?php
/**
 * Admin template: Donations list.
 *
 * $this is the DonationsList (WP_List_Table) instance — all
 * WP_List_Table methods (display, search_box, views) are available.
 *
 * @package Donatico
 */

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

// Variables are set by DonationsList::render() before this template is included.
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound

// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$deleted = isset( $_GET['deleted'] ) && '1' === $_GET['deleted'];
?>

<div class="wrap donatico-wrap">
	<h1 class="wp-heading-inline"><?php esc_html_e( 'Donations', 'donatico' ); ?></h1>
	<hr class="wp-header-end">

	<?php if ( $deleted ) : ?>
		<div class="notice notice-success is-dismissible">
			<p><?php esc_html_e( 'Donation deleted successfully.', 'donatico' ); ?></p>
		</div>
	<?php endif; ?>

	<form id="donatico-donations-filter" method="get">
		<input type="hidden" name="page" value="donatico-donations">

		<?php
		$this->views();
		$this->search_box( __( 'Search Donations', 'donatico' ), 'donatico-search' );
		$this->display();
		?>
	</form>
</div>
