<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/** @var $block \Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\Files */

$_width  = $block->getImagesWidth();

?>
<?php if ($block->getFilesCount() > 0): ?>
    <?php foreach ($block->getFiles() as $file): ?>
        <?php
            $src = $block->getFileThumbUrl($file);
            $width = $block->getFileWidth($file);
            $height = $block->getFileHeight($file);
            $filename = $block->getFileName($file);
        ?>
    <div
        data-row="file"
        class="filecnt"
        id="<?= $block->escapeHtmlAttr($block->getFileId($file)) ?>"
        data-size="<?= $block->escapeHtmlAttr($file->getSize()) ?>"
        data-mime-type="<?= $block->escapeHtmlAttr($file->getMimeType()) ?>"
    >
        <p class="nm">
        <?php if ($block->getFileThumbUrl($file)): ?>
            <img src="<?= $block->escapeHtmlAttr($src) ?>" alt="<?= $block->escapeHtmlAttr($filename) ?>"/>
        <?php endif; ?>
        </p>
        <?php if ($block->getFileWidth($file)): ?>
              <small><?= $block->escapeHtmlAttr($width) ?>x<?= $block->escapeHtmlAttr($height) ?>
                                                                   <?= $block->escapeHtml(__('px.')) ?></small><br/>
        <?php endif; ?>
        <small><?= $block->escapeHtml($block->getFileShortName($file)) ?></small>
    </div>
    <?php endforeach; ?>
<?php else: ?>
    <div class="empty"><?= $block->escapeHtml(__('No files found')) ?></div>
<?php endif; ?>
