<% if asset.previewable? %>
<% if wopi_enabled? && wopi_file?(asset) %>
<% elsif asset.pdf_previewable? %>
<%= render partial: 'shared/pdf_viewer', locals: { asset: asset, report_document: false } %>
<% else %>
<%= image_tag asset.large_preview,
class: 'asset-image',
style: 'opacity: 0' %>
<% end %>
<% else %>
<%= render partial: 'shared/file_preview/file_icon', locals: { asset: asset } %>
<% end %>
<%= javascript_include_tag 'shared/file_preview', nonce: true %>