<section class="animated-shadow-sky sky-section">
  <h2 class="section-header">
    <span class="font-medium text-slate-900">Similar Users</span>
  </h2>
  <% factors = Domain::Factors::UserUserFollowToFactors.find_by(user: user) %>
  <% if factors %>
    <% nearest_neighbors = Domain::NeighborFinder.find_neighbors(factors).includes(:user).limit(10) %>
    <% nearest_neighbors.each do |neighbor| %>
      <% user = neighbor.user %>
      <div class="flex items-center gap-2 whitespace-nowrap text-slate-600 justify-between w-full px-4 py-2">
        <%= render "domain/has_description_html/inline_link_domain_user", user: user, visual_style: "sky-link" %>
        <% if !defined?(with_post_count) || with_post_count %>
          <span class="ml-2 text-slate-500">
            <%= pluralize(number_with_delimiter(user.user_post_creations.size, delimiter: ","), "post") %>
          </span>
        <% end %>
      </div>
    <% end %>
  <% else %>
    <div class="px-4 py-3 text-slate-500">No similar users</div>
  <% end %>
</section>
