<% result ||= report_element.result %>
<% result_text = result.result_text %>
<% timestamp = result.created_at %>
<% name = result.name %>
<% export_all = defined?(export_all) && export_all %>
<div class="report-element report-result-element report-result-text-element">
  <div class="report-element-header">
    <div class="row">
      <div class="pull-left result-icon">
          <span class="fas fa-asterisk"></span>
      </div>
      <div class="pull-left result-name">
        <%= name %>
        <% if result.archived? %>
          <span class="label label-warning"><%= t('search.index.archived') %></span>
        <% end %>
      </div>
      <div class="pull-left user-time">
        <%= t('projects.reports.elements.result_text.user_time', user: result.user.full_name, timestamp: l(timestamp, format: :full)) %>
      </div>
    </div>
  </div>
  <div class="report-element-body">
    <div class="row">
      <div class="col-xs-12 text-container ql-editor">
        <%= custom_auto_link(result_text.prepare_for_report(:text, export_all),
                             team: current_team,
                             simple_format: false,
                             tags: %w(img),
                             base64_encoded_imgs: export_all) %>
      </div>
    </div>
  </div>
  <div class="report-element-children">
    <% if @settings.dig('task', 'result_comments') %>
      <%= render partial: 'reports/elements/result_comments_element.html.erb', locals: { result: result } %>
    <% end %>
  </div>
  <% if defined?(children) %>
    <div class="report-element-children">
      <%= children %>
    </div>
  <% end %>
</div>
