<% edit_mode = action_name == "edit" %>
<div class="card-header d-flex">
  <i class="h4 bi <%= success_criterion_result_icon_classes(success_criterion) %>"></i>
  <p
    data-bs-toggle="collapse"
    href="#collapseSuccessCriterion_<%= success_criterion.id %>" 
    role="button" 
    aria-expanded="false" 
    aria-controls="collapseSuccessCriterion_<%= success_criterion.id %>"
    style="cursor: pointer">
    <%= success_criterion.page.position %>.<%= success_criterion.element.position %>.<%= success_criterion.position %>
    <%= success_criterion.title %> 
    <span class="badge rounded-pill text-bg-secondary">
      <%= success_criterion.level %>
    </span>
    <% if success_criterion.test_comment.present? %>
      <i class="bi bi-chat"></i>
    <% end %>
    <% if false && action_name == "edit" %>
      <a href="#">
      <i class="bi bi-pencil text-warning"></i>
    <% end %>
  </p>
    <%= success_criterion_edit_button(success_criterion, edit_mode) %>
    <div class="flex-fill d-flex justify-content-end">
      <button class="btn btn-link text-body"
        data-controller="collapse-chevron-toggler"
        data-bs-toggle="collapse"
        href="#collapseSuccessCriterion_<%= success_criterion.id %>" 
        role="button" 
        aria-expanded="false" 
        aria-controls="collapseSuccessCriterion_<%= success_criterion.id %>"
      >
      <i class="bi bi-chevron-down" data-collapse-chevron-toggler-target="icon"></i>
      </button>
    </div>
</div>