<?php
/**
 * OAuth integration service provider.
 *
 * @package WP_PowerSuite\OAuth
 * @since 1.0.0
 */

namespace WP_PowerSuite\OAuth;

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

final class OAuthServiceProvider {

	public static function register(): void {
		add_action( 'init', [ self::class, 'registerSocialAccountPanel' ], 5 );
	}

	public static function registerSocialAccountPanel(): void {
		if ( ! ModuleLoader::anySocialActive() ) {
			return;
		}

		if ( ! class_exists( '\WP_PowerSuite\OAuth\Accounts\SocialAccountPanelService' ) ) {
			return;
		}

		Accounts\SocialAccountPanelService::register();
	}
}
