<div class="inline-attachment-container asset">
  <div class="header">
    <div class="file-info">
      <%= link_to '#',
        class: "shareable-file-preview-link file-name",
        id: "modal_link#{asset.id}",
        data: {
            no_turbolink: true,
            id: asset.id
          } do %>
        <span data-toggle="tooltip"
              data-placement="bottom"
              title="<%= asset.render_file_name %>">
          <%= asset.render_file_name %>
        </span>
      <% end %>
      <div class="file-metadata">
        <span><%= t('assets.placeholder.modified_label') %> <span class="iso-formatted-date"><%= asset.updated_at.iso8601 if asset.updated_at %></span></span>
        <span><%= t('assets.placeholder.size_label', size: number_to_human_size(asset.file_size)) %></span>
      </div>
    </div>
    <% if defined?(show_context) && show_context %>
      <%= render partial: "shareable_links/my_modules/step_attachments/context_menu", locals: { asset: asset } %>
    <% end %>
  </div>
  <% if asset.pdf_previewable? %>
    <%= render partial: 'shared/pdf_viewer', locals: { asset: asset, report_document: false, shareable_document: true } %>
  <% elsif asset.previewable? && asset.large_preview&.image&.attached? %>
    <div class="image-container">
      <%= image_tag asset.large_preview.url(expires_in: Constants::URL_SHORT_EXPIRE_TIME.minutes),
          class: 'asset-preview-image',
          style: 'opacity: 0' %>
    </div>
  <% else %>
    <div class="general-file-container">
      <i class="fas <%= file_fa_icon_class(asset) if asset.file_name %>"></i>
    </div>
  <% end %>
</div>
