<div id="p-index-by-post">
  <% if @posts.blank? %>
    <%= render "post_sets/blank" %>
  <% end %>

  <% @posts.select(&:visible?).each do |post| %>
    <%= tag.div id: "post_#{post.id}", **PostPreviewComponent.new(post: post).article_attrs("post") do %>
      <div class="preview">
        <%= link_to(image_tag(post.preview_file_url), post_path(post)) %>
      </div>

      <div class="comment-section">
        <%= render "comments/partials/index/header", post: post %>
        <%= render_comment_section(post, limit: 6, current_user: CurrentUser.user) %>
      </div>
    <% end %>
  <% end %>
</div>

<%= numbered_paginator(@posts) %>
