<?php

/**
 * Admin sync settings page.
 *
 * @package northmill-online-shared
 */
declare (strict_types=1);
namespace Northmill_Online_Shared_Checkout;

/**
 * View parameters.
 *
 * @var array $params
 */
\defined('ABSPATH') || exit;
?>
<div class="wrap" id="nms-settings-sync">
	<h1><?php 
echo \esc_html(\__('Settings sync', 'northmill-online-shared'));
?></h1>

	<form method="post">
		<table class="widefat sync-settings-table">
			<thead>
			<tr>
				<th colspan="2">
					<h2 class="sync-settings-table__heading"><?php 
echo \esc_html__('Sync', 'northmill-online-shared');
?></h2>
				</th>
			</tr>
			</thead>
			<tbody>
			<tr>
				<td>
					<div id="nms-sync-status">
						<?php 
echo $params['sync_status'];
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
					</div>
				</td>
				<td>
					<div id="nms-sync-log">
					</div>
				</td>
			</tr>
			</tbody>
			<tfoot>
			<tr>
				<td colspan="2">
					<input type="button" id="nms-enable-sync" class="button button-primary" value="<?php 
\esc_html_e('Enable automatic sync', 'northmill-online-shared');
?>" style="display: none;" />
					<input type="button" id="nms-disable-sync" class="button button-primary" value="<?php 
\esc_html_e('Disable automatic sync', 'northmill-online-shared');
?>" style="display: none;" />
					<input type="button" id="nms-sync-now" class="button button-primary" value="<?php 
\esc_html_e('Sync now', 'northmill-online-shared');
?>" style="float: right;" />
					<br>
					<?php 
\esc_html_e('The automatic sync runs every 5 minutes when enabled', 'northmill-online-shared');
?>
				</td>
			</tr>
			</tfoot>
		</table>
	</form>

	<div id="data-preview">
		<?php 
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $params['data_preview'];
?>
	</div>
</div>
<?php 
