<% table ||= report_element.table %>
<% timestamp = table.created_at %>
<div class="report-element report-step-attachment-element report-step-table-element">
  <div class="report-element-header">
    <div class="table-name">
      <% if defined? export_all and export_all %>
        <% file_link = @obj_filenames.dig(:tables, table.id, :file) %>
        <a href="<%= file_link %>">
          <em>
            <%= file_link&.split('/')&.last %>
          </em>
        </a>
      <% else %>
        <% if table.name.present? %>
          <em>
            <%= truncate(table.name, length: Constants::FILENAME_TRUNCATION_LENGTH) %>
          </em>
        <% end %>
      <% end %>
    </div>
    <% unless @settings['exclude_timestamps'] %>
      <div class="user-time">
        <%= t("projects.reports.elements.#{table_type}.user_time", timestamp: l(timestamp, format: :full)) %>
      </div>
    <% end %>
  </div>
  <div class="report-element-body">
    <div class="report-native-table report-common-table-format simple-table" id="native-table-<%= table.id %>">
      <%= render partial: 'protocols/table_element', locals: { table: table }%>
    </div>
  </div>
  <% if defined?(children) %>
    <div class="report-element-children">
      <%= children %>
    </div>
  <% end %>
</div>
