<?php
/**
 * Inline Theme 5 — Badge.
 *
 * @package     Relatedly\Theming\Inline
 * @since       2.0.0
 * @fs_premium_only
 */

namespace Relatedly\Theming\Inline;

use Relatedly\Theming\AbstractTheme;

defined( 'ABSPATH' ) || exit;

/**
 * Renders the premium badge inline theme.
 *
 * @since 2.0.0
 */
class Theme5Badge extends AbstractTheme {
	/**
	 * Template file name.
	 *
	 * @var string
	 */
	protected string $template_file = 'inline/badge.php';

	/**
	 * Get the tracking display type.
	 *
	 * @return string
	 */
	protected function display_type(): string {
		return 'inline'; }

	/**
	 * Build template variables.
	 *
	 * @param \WP_Post $post      Post object.
	 * @param int|null $source_id Source post ID.
	 * @return array<string,mixed>
	 */
	protected function template_vars( \WP_Post $post, ?int $source_id ): array {
		$vars             = parent::template_vars( $post, $source_id );
		$vars['css_vars'] = $this->css_vars(
			array(
				'--relatedly-bg'          => 'inline_theme5_bg',
				'--relatedly-text-color'  => 'inline_theme5_text_color',
				'--relatedly-label-color' => 'inline_theme5_label_color',
				'--relatedly-font-size'   => 'inline_theme5_font_size',
				'--relatedly-label-size'  => 'inline_theme5_label_size',
				'--relatedly-padding'     => 'inline_theme5_padding',
			)
		);
		return $vars;
	}
}
