<?php
/**
 * Elementor Pro Theme Builder condition — dealer single.
 *
 * @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\DealerPostType;

class DealerCondition extends Condition_Base {

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

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

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

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

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