<?php
/**
 * Elementor Pro Theme Builder condition — vehicle single + archive.
 *
 * Adds "Vehicles" subconditions under "Singular" and "Archive" in the
 * Display Conditions modal so a Single template can target all vehicles or
 * vehicles in a specific make/body-style/condition.
 *
 * @package ThemeREX\AutoDealer
 */

declare(strict_types=1);

namespace ThemeREX\AutoDealer\Elementor\ThemeBuilder;

if ( ! class_exists( '\ElementorPro\Modules\ThemeBuilder\Conditions\Condition_Base' ) ) {
	return;
}

use ElementorPro\Modules\ThemeBuilder\Conditions\Condition_Base;
use ThemeREX\AutoDealer\PostTypes\VehiclePostType;

class VehicleCondition extends Condition_Base {

	public static function get_type(): string {
		return 'singular';
	}

	public function get_name(): string {
		return 'trx_ad_vehicle';
	}

	public function get_label(): string {
		return __( 'Vehicles', 'trx-auto-dealer' );
	}

	public function get_all_label(): string {
		return __( 'All Vehicles', 'trx-auto-dealer' );
	}

	public function check( $args ): bool {
		return is_singular( VehiclePostType::POST_TYPE );
	}
}
