<?php
/**
 * PeachPay WC Subscriptions Importer settings.
 *
 * @package PeachPay
 */

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

/**
 * PeachPay WC Subscriptions Importer settings page.
 */
final class PeachPay_WC_Subscription_Import_Settings extends PeachPay_Admin_Tab {

	/**
	 * Tab id.
	 *
	 * @var string
	 */
	public $id = 'wc-subscription-import';

	/**
	 * Gets section key.
	 *
	 * @return string
	 */
	public function get_section() {
		return 'wc-subscription-import';
	}

	/**
	 * Gets tab key.
	 *
	 * @return string
	 */
	public function get_tab() {
		return 'settings';
	}

	/**
	 * Gets title.
	 *
	 * @return string
	 */
	public function get_title() {
		return __( 'WC Subscriptions Importer', 'peachpay-for-woocommerce' );
	}

	/**
	 * Gets description.
	 *
	 * @return string
	 */
	public function get_description() {
		return __( 'Migrate subscription renewal metadata from the legacy ConvesioPay integration to PeachPay so existing WooCommerce subscriptions can continue renewing without interruption. The importer performs a non-destructive migration and also supports rolling back the changes if needed.', 'peachpay-for-woocommerce' );
	}

	/**
	 * Includes dependencies.
	 */
	protected function includes() {}

	/**
	 * No persisted form fields for this page.
	 *
	 * @return array
	 */
	protected function register_form_fields() {
		return array();
	}

	/**
	 * Render importer admin view.
	 *
	 * @return void
	 */
	public function do_admin_view() {
		?>
		<style>
			.pp-admin-content-wrapper .pp-admin-content {
				gap: 5px;
			}
		</style>
		<h3><?php echo esc_html( $this->get_title() ); ?></h3>
		<p><?php echo wp_kses_post( $this->get_description() ); ?></p>
		<hr>
		<?php
		require PeachPay::get_plugin_path() . '/core/admin/views/html-wc-subscription-importer-page.php';
	}
}
