<?php
/**
 * Shared plugin banner.
 *
 * @package NaveenCodesImageOptimizer
 */

defined( 'ABSPATH' ) || exit;

if ( empty( $banner ) || ! is_array( $banner ) ) {
	return;
}
(
	static function ( $banner ) {
		?>
<section class="naveencodes-banner" aria-label="<?php esc_attr_e( 'NaveenCodes Image Optimizer banner', 'naveencodes-image-optimizer' ); ?>">
	<div class="naveencodes-banner-copy">
		<span class="naveencodes-banner-kicker"><?php esc_html_e( 'NaveenCodes Image Optimizer', 'naveencodes-image-optimizer' ); ?></span>
		<h2 class="naveencodes-banner-title"><?php echo esc_html( $banner['title'] ?? '' ); ?></h2>
		<p class="naveencodes-banner-text"><?php echo esc_html( $banner['summary'] ?? '' ); ?></p>
		<div class="naveencodes-banner-pills">
			<?php foreach ( (array) ( $banner['highlights'] ?? array() ) as $ultra_image_optimizer_highlight ) : ?>
				<span class="naveencodes-banner-pill"><?php echo esc_html( $ultra_image_optimizer_highlight ); ?></span>
			<?php endforeach; ?>
		</div>
	</div>
	<div class="naveencodes-banner-stats">
		<?php foreach ( (array) ( $banner['stats'] ?? array() ) as $ultra_image_optimizer_stat ) : ?>
			<div class="naveencodes-banner-stat">
				<span class="naveencodes-banner-stat-value"><?php echo esc_html( $ultra_image_optimizer_stat['value'] ?? '' ); ?></span>
				<span class="naveencodes-banner-stat-label"><?php echo esc_html( $ultra_image_optimizer_stat['label'] ?? '' ); ?></span>
			</div>
		<?php endforeach; ?>
	</div>
</section>
		<?php
	}
)( $banner );
