<?php
/**
 * IntegrationSourceOption.php.
 *
 * @package RewardsWP
 */

namespace Awesomemotive\Rewardswp\Settings\Options\Integrations;

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

use Awesomemotive\Rewardswp\Abstracts\AbstractOption;
use Awesomemotive\Rewardswp\Interfaces\IntegrationInterface;
use Awesomemotive\Rewardswp\Interfaces\OptionInterface;
use Awesomemotive\Rewardswp\Services\OptionsService;

/**
 * Class IntegrationSourceOption.
 */
class IntegrationSourceOption extends AbstractOption implements OptionInterface {
	/**
	 * Options service instance.
	 *
	 * @since 1.0.0
	 *
	 * @var OptionsService
	 */
	protected OptionsService $options_service;

	/**
	 * Get the setting key used in the option array.
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	public function get_name(): string {
		return 'integration_source';
	}

	/**
	 * Get the setting group.
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	public function get_group(): string {
		return 'integrations';
	}

	/**
	 * Get the default value for the setting.
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	public function get_default_value(): string {
		return '';
	}

	/**
	 * The value is dynamically populated by the current active integration.
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	public function get_value(): string {
		return $this->integration->get_source();
	}

	/**
	 * Get the label for the setting.
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	public function get_label(): string {
		return esc_html__( 'Source', 'rewardswp' );
	}

	/**
	 * Get the type of the setting (text, textarea, select, etc).
	 *
	 * @since 1.0.0
	 *
	 * @return string
	 */
	public function get_type(): string {
		return 'radio';
	}
}
