<xf:macro name="attachment_list_item" arg-attachment="!" arg-canView="!">
	<li class="file file--linked">
		<xf:if is="$attachment.has_thumbnail">
			<xf:macro template="lightbox_macros" name="setup" arg-canViewAttachments="{$canView}" />

			<a class="file-preview {{ $canView ? 'js-lbImage' : '' }}" href="{$attachment.direct_url}" target="_blank">
				<img src="{$attachment.thumbnail_url}" alt="{$attachment.filename}"
					width="{$attachment.thumbnail_width}" height="{$attachment.thumbnail_height}" loading="lazy" />
			</a>
		<xf:elseif is="$attachment.is_video AND $canView" />
			<a class="file-preview" href="{$attachment.direct_url}" target="_blank">
				<video data-xf-init="video-init">
					<source src="{$attachment.direct_url}" />
				</video>
			</a>
		<xf:else />
			<a class="file-preview" href="{$attachment.direct_url}" target="_blank">
				<span class="file-typeIcon">
					<xf:fa icon="{$attachment.icon}" />
				</span>
			</a>
		</xf:if>

		<div class="file-content">
			<div class="file-info">
				<span class="file-name" title="{$attachment.filename}">{$attachment.filename}</span>
				<div class="file-meta">
					{$attachment.file_size|file_size} &middot; {{ phrase('views:') }} {$attachment.view_count|number}
				</div>
			</div>
		</div>
	</li>
</xf:macro>