<%# locals: (attachable:)  %>

<% attachments = attachable.attachments.includes(blob: { variant_records: { image_attachment: :blob }}).load %>
<% if attachments.any? %>
  <div class="user-screenshots">
    <% attachments.each do |attachment| %>
      <%# .url will be the AWS URL if we've created the variant already. %>
      <%= link_to url_for(attachment.blob) do %><%= image_tag attachment.variant(resize_to_limit: [200, 200]).url || attachment.variant(resize_to_limit: [200, 200]) %><% end %>
    <% end %>
  </div>
<% end %>
