<?php
/**
 * User Info Block — Template
 *
 * @var \WP_User $user          The fundraiser owner.
 * @var int      $active_count  Number of active fundraisers by this user.
 *
 * @package AmbassadorHub\Fundraisers\Blocks\UserInfo
 */

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

use AmbassadorHub\Accounts\ProfilePicture;
?>
<div class="ambh-user-info">
	<div class="ambh-user-info__avatar">
		<?php
		echo wp_kses_post(
			ProfilePicture::get_profile_picture(
				$user->ID,
				'thumbnail',
				array(
					'class'  => 'ambh-user-info__img',
					'width'  => '40',
					'height' => '40',
					'alt'    => esc_attr( $user->display_name ),
				)
			)
		);
		?>
	</div>
	<div class="ambh-user-info__details">
		<span class="ambh-user-info__name"><?php echo esc_html( $user->display_name ); ?></span>
		<span class="ambh-user-info__count">
			<?php
			echo esc_html(
				sprintf(
					/* translators: %d: number of active fundraisers */
					_n( '%d active fundraiser', '%d active fundraisers', $active_count, 'ambassadorhub' ),
					$active_count
				)
			);
			?>
		</span>
	</div>
</div>
