<% if wopi_enabled? && wopi_file?(asset) %>
<% if asset.file_size.positive? %>
<% else %>
<%= t('assets.empty_office_file.description') %>
<%= button_to(load_asset_path(asset),
method: :get,
remote: true,
form_class: 'reload-asset',
class: 'btn btn-primary',
params: { asset: {view_mode: asset.view_mode }}) do %>
<%= t('assets.empty_office_file.reload') %>
<% end %>
<% end %>
<% elsif asset.pdf_previewable? %>
<%= render partial: 'shared/pdf_viewer.html.erb', locals: { asset: asset } %>
<% elsif asset.previewable? %>
<%= image_tag asset.large_preview,
onerror: 'ActiveStoragePreviews.reCheckPreview(event)',
onload: 'ActiveStoragePreviews.showPreview(event)',
style: 'opacity: 0' %>
<% else %>
<% end %>