<?php

use Tangibledesign\Framework\Models\Image;
use Tangibledesign\Framework\Widgets\General\LogoWidget;

/* @var LogoWidget $mhCurrentWidget */
global $mhCurrentWidget;

$mhLogo = $mhCurrentWidget->getLogo();
if (!$mhLogo instanceof Image) {
    return;
}
?>
<div class="myhome-image-wrapper">
    <?php if ($mhCurrentWidget->isLink()) : ?>
        <a class="myhome-image" href="<?php echo esc_url(site_url()); ?>">
            <img
                    class="lazyload"
                    data-src="<?php echo esc_url($mhLogo->getImageUrl($mhCurrentWidget->getImageSize())); ?>"
                    alt="<?php echo esc_attr(get_bloginfo('name')); ?>"
            >
        </a>
    <?php else: ?>
        <div class="myhome-image">
            <img
                    class="lazyload"
                    data-src="<?php echo esc_url($mhLogo->getImageUrl($mhCurrentWidget->getImageSize())); ?>"
                    alt="<?php echo esc_attr(get_bloginfo('name')); ?>"
            >
        </div>
    <?php endif; ?>
</div>