<?php
/**
 * @author     FutrX
 * @year       2023
 * @package    futrx.com
 * @subpackage NoMoreBots\Admin
 */

namespace NoMoreBots\Admin;

use Carbon_Fields\Carbon_Fields;

class Pages {

	public function __construct() {
		add_action( 'plugins_loaded', array( $this, 'load_carbon_fields' ) );
		add_action( 'carbon_fields_register_fields', array( $this, 'register_carbon_fields' ) );
		add_action(
			'carbon_fields_theme_options_container_saved',
			array(
				'NoMoreBots\Admin\Pages\Settings',
				'save_values',
			)
		);
	}

	/**
	 * Boots up Carbon Fields.
	 *
	 * @return void
	 */
	public function load_carbon_fields(): void {
		Carbon_Fields::boot();
	}

	/**
	 * Renders the Settings Page using Carbon Fields.
	 *
	 * @return void
	 * @since 1.0.0
	 */
	public function register_carbon_fields(): void {
		Pages\Settings::render();
		Pages\BlockedList::render();
	}
}
