<% if @resources.present? %> <%= content_tag :div, class:"w-full grid grid-cols-1 xs:grid-cols-2 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-6 gap-6 mt-8", data: { component_name: self.class.to_s.underscore, selected_resources_name: @resource.model_key, selected_resources: [], **(try(:drag_reorder_data_attributes) || {}) } do %> <% @resources.each_with_index do |resource, index| %> <% cache_if Avo.configuration.cache_resources_on_index_view, resource.cache_hash(@parent_record) do %> <%= render(resource.resolve_component(Avo::Index::GridItemComponent).new(resource: resource, reflection: @reflection, parent_record: @parent_record, parent_resource: @parent_resource, actions: actions)) %> <% end %> <% end %> <% end %> <% else %>
<%= helpers.empty_state by_association: params[:related_name].present?, view_type: :grid %>
<% end %>