<%= render PaginationComponent.new(data: @results, opts: { is_subject_breadcrums: true, subject_ids: params[:subject_ids], is_index_table: params[:is_index_table] }) %>

<% @uniq_by_headnotes.each do |uniq_by_headnote| %>
<%= uniq_by_headnote.headnote %>
<% uniq_by_contents = @results.map { |doctrine| doctrine if doctrine.headnote.eql?(uniq_by_headnote.headnote) }.uniq(&:content) %> <% uniq_by_contents.each do |uniq_by_content| %>
<%= raw uniq_by_content.content.html_safe %>
<% doctrines = @results.map { |doctrine| doctrine if doctrine.headnote.eql?(uniq_by_headnote.headnote) && doctrine.content.eql?(uniq_by_content.content) } %> <%= render(DoctrineIndexComponent.with_collection(doctrines, current_user: current_user, opts: { is_index_table: false, subject_ids: params[:subject_ids].map(&:to_i) })) %> <% end %>

<% end %>