<?php
/**
 * Image overlay layer.
 *
 * @package Kutby
 * @since   2.8.0
 */

declare(strict_types=1);

namespace Kutby\Hero\Components;

use Kutby\Hero\Contracts\HeroComponentInterface;
use Kutby\Hero\Support\HeroContext;

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

/**
 * Class Overlay
 */
final class Overlay implements HeroComponentInterface {

	/**
	 * {@inheritdoc}
	 */
	public static function render( HeroContext $ctx, array $args = array() ): void {
		if ( ! $ctx->bool( 'overlay' ) && empty( $args['force'] ) ) {
			return;
		}
		echo '<span class="kutby-hero-overlay" aria-hidden="true"></span>';
	}
}
