{% if files %}
<style>.files-listing td, .files-listing th { padding: 0.4em 0.5em; } .files-listing th { font-weight: bold; } .files-listing td:last-child, .files-listing th:last-child { padding-right: 0; }</style>
<table class="files-listing">
    <thead>
        <tr>
            <th>Filename</th>
            <th>Type</th>
            <th>Size</th>
            {% if show_source %}<th>Source</th>{% endif %}
            <th>Uploaded</th>
        </tr>
    </thead>
    <tbody>
        {% for file in files %}
        <tr>
            <td>
                <a href="{{ urls.path('/-/files/' ~ file.id) }}">
                <img src="{{ urls.path('/-/files/' ~ file.id ~ '/thumbnail') }}" alt="{{ file.filename }}" loading="lazy" style="width:60px;height:40px;object-fit:contain;vertical-align:middle;border-radius:2px;margin-right:6px;">
                    {{ file.filename }}
                </a>
            </td>
            <td>{{ file.content_type or "" }}</td>
            <td>{{ file.size }} bytes</td>
            {% if show_source %}<td><a href="{{ urls.path('/-/files/source/' ~ file.source_slug) }}">{{ file.source_slug }}</a></td>{% endif %}
            <td>{{ file.created_at }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% endif %}
