<?php if (isset($file)): ?>
    <?php
        $sizes = isset($size) ? '(min-width: 1085px) ' . $size . 'vw, 100vw' : '(min-width: 1085px) 50vw, 100vw';
        $alt = $file->alt() ?? '';
        $crop = $crop ?? false;

        $webPSrcset = $file->srcset('webp');
        $srcset = $file->srcset();
        $src = $file->url();
        $width = $file->resize(1800)->width();
        $height = $file->resize(1800)->height();
        $class = isset($class) ? 'class="' . $class . '"': '';
        $lazy = $lazy ?? true;
        $span = isset($span) ? 'style="--span: ' . $span . ';"': '';
    ?>



    <picture <?= $class ?> <?= $span ?> data-id="<?= $file->uuid() ?>" orientation="<?= $file->orientation() ?>">
        
        <source srcset="<?= $webPSrcset ?>"
            sizes="<?= $sizes ?>" type="image/webp">
        <img 
            src="<?= $src ?>"
            srcset="<?= $srcset ?>"
            sizes="<?= $sizes ?>"
            width="<?= $width ?>"
            height="<?= $height ?>"
            alt="<?= $alt?>"
        >
        <div class="loader"></div>
    </picture>
<?php endif ?>
