<% if asset.previewable? %>
<% if wopi_enabled? && wopi_file?(asset) %>
<% else %>
<%= image_tag asset.large_preview,
onerror: 'ActiveStoragePreviews.reCheckPreview(event)',
onload: 'ActiveStoragePreviews.showPreview(event)',
style: 'opacity: 0' %>
<% end %>
<% else %>
<%= render partial: 'shared/file_preview/file_icon.html.erb', locals: { asset: asset } %>
<% end %>