<?php
/**
 * Emails settings content view.
 *
 * @package Awesomemotive\Rewardswp\Views\Admin\Parts
 * @since 1.0.0
 */

namespace Awesomemotive\Rewardswp\Views\Admin\Parts;

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

use Awesomemotive\Rewardswp\Abstracts\AbstractView;
use Awesomemotive\Rewardswp\Interfaces\ViewInterface;
use Awesomemotive\Rewardswp\Factories\ViewsFactory;
use function Awesomemotive\Rewardswp\Helpers\get_view_component;
use function Awesomemotive\Rewardswp\Helpers\kses;

/**
 * Class EmailsSettingsContentView
 *
 * View for email settings configuration.
 *
 * @since 1.1.0
 */
class EmailsSettingsContentView extends AbstractView implements ViewInterface {

	private ViewsFactory $views_factory;

	public function __construct( ViewsFactory $views_factory ) {
		$this->views_factory = $views_factory;
	}

	/**
	 * Render the template.
	 *
	 * @since 1.1.0
	 *
	 * @param array $args {
	 *     Optional arguments.
	 * }
	 *
	 * @return void
	 */
	public function render( array $args = [] ): void {
		?>
		<div class="space-y-6">
			<?php
			echo wp_kses(
				get_view_component(
					'section',
					[
						'title'   => esc_html__( 'Email Settings', 'rewardswp' ),
						'content' => $this->views_factory->get_view( EmailOptionsContentView::class )->get_contents(),
						'id'      => 'emails_options',
					]
				),
				kses()
			);
			?>
		</div>
		<?php
	}
}