{namespace neos=Neos\Neos\ViewHelpers}

<ul class="c-asset-list">
    <f:if condition="{assets}">
        <f:for each="{assets}" as="asset">
            <f:render section="asset" arguments="{asset: asset, class: class}" />
        </f:for>
    </f:if>
</ul>

<f:section name="asset">
    <li class="c-asset-list__item c-asset">
        <svg
            class="c-icon c-asset__icon"
            aria-hidden="true">
            <use xlink:href="#icon-download"></use>
        </svg>
        <div class="c-asset__text">
            <a class="c-asset__name" href="{f:uri.resource(resource: asset.resource)}" download target="_blank">
                {f:if(condition: asset.title, then: asset.title, else: asset.resource.filename)}
            </a>
            <span class="c-asset__meta">
                ({asset.resource.fileExtension} - {asset.resource.fileSize -> f:format.bytes()})
            </span>
        </div>
    </li>
</f:section>
