<% if available_view_types.count > 1 %> <% info = { table: { new_view_type: 'grid', new_icon: 'view-grid', translation_key: 'avo.grid_view', }, grid: { new_view_type: 'table', new_icon: 'view-list', translation_key: 'avo.table_view', }, } %>
<% available_view_types.each do |type| %> <%= a_link params.permit!.merge(view_type: type), color: :secondary, variant: :outlined, class: view_type.to_s == type.to_s ? 'bg-gray-200' : '', 'data-turbo-frame': turbo_frame, title: t('avo.switch_to_view', view_type: type), 'data-tippy': 'tooltip' do %> <%= svg info[type][:new_icon] %> <% end %> <% end %>
<% end %>