<?php
/**
 * Footer logo component.
 *
 * @package Kutby
 * @since   2.7.0
 */

declare(strict_types=1);

namespace Kutby\Footer\Components;

use Kutby\Footer\Contracts\FooterComponentInterface;
use Kutby\Footer\Support\FooterContext;
use Kutby\TemplateTags\Tags;

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

/**
 * Class Logo
 */
final class Logo implements FooterComponentInterface {

	/**
	 * {@inheritdoc}
	 */
	public static function render( FooterContext $ctx, array $args = array() ): void {
		if ( ! $ctx->bool( 'show_logo' ) ) {
			return;
		}

		$class = isset( $args['class'] ) ? (string) $args['class'] : 'kutby-footer-branding';
		echo '<div class="' . esc_attr( $class ) . '">';
		Tags::logo();
		echo '</div>';
	}
}
