<?php // phpcs:ignore WordPress.Files.FileName
/**
 * Plugin Panel : the receiver list
 *
 * @package YITH\PayPalPayouts\Admin
 */

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

$default = isset( $option['default'] ) ? $option['default'] : array();

$id = $option['id']; //phpcs:ignore

$values = get_option( $id, $default );

?>


<div id="<?php echo esc_attr( $id ); ?>-container" <?php echo yith_field_deps_data( $option ); //phpcs:ignore WordPress.Security.EscapeOutput ?>class="yith-plugin-fw-metabox-field-row">
	<table class="widefat yith_payouts_receiver_table striped">
		<thead>
		<tr>
			<th><?php esc_html_e( 'User', 'yith-paypal-payouts-for-woocommerce' ); ?></th>
			<th><?php esc_html_e( 'PayPal Email', 'yith-paypal-payouts-for-woocommerce' ); ?></th>
			<th><?php esc_html_e( 'Commission', 'yith-paypal-payouts-for-woocommerce' ); ?></th>
			<th></th>
		</tr>
		</thead>
		<tbody>
		<?php
		if ( is_array( $values ) && count( $values ) > 0 ) {
				$i = 0;
			foreach ( $values as $receiver ) {

				include 'yith_payouts_single_receiver.php';
				$i++;
			}
		}
		?>
		</tbody>
		<tfoot>
		<tr>
			<th colspan="4">
				<a href="#" class="button insert"><?php esc_html_e( 'Add new receiver', 'yith-paypal-payouts-for-woocommerce' ); ?></a>
			</th>
		</tr>
		</tfoot>
	</table>
</div>
