<% if can?(:update, template) && !template.archived_at? && template.account_id == current_account.id %>
<%= svg_icon('folder_share', class: 'w-4 h-4') %>
<% end %>
<% if template.archived_at? && can?(:update, template) %>
<%= button_to template_restore_index_path(template), class: 'btn btn-xs hover:btn-outline bg-base-200 btn-circle' do %>
<%= svg_icon('rotate', class: 'w-4 h-4 enabled') %>
<%= svg_icon('loader', class: 'w-4 h-4 animate-spin disabled') %>
<% end %>
<% elsif can?(:update, template) %>
<%= svg_icon('pencil', class: 'w-4 h-4') %>
<% end %>
<% if can?(:create, template) %>
<%= svg_icon('copy', class: 'w-4 h-4') %>
<% end %>
<% if can?(:destroy, template) %>
<%= button_to template_path(template), data: template.archived_at? ? { turbo_confirm: t('template_deletion_is_irreversible_and_will_permanently_remove_all_associated_signed_documents_with_it_are_you_sure_') } : {}, params: { permanently: template.archived_at? }.compact_blank, method: :delete, class: 'btn btn-xs hover:btn-outline bg-base-200 btn-circle', aria_label: t('restore') do %>
<%= svg_icon(template.archived_at? ? 'trash' : 'archive', class: 'w-4 h-4 enabled') %>
<%= svg_icon('loader', class: 'w-4 h-4 animate-spin disabled') %>
<% end %>
<% end %>