<%= link_to import_path(import), class: "text-sm text-primary hover:underline" do %> <% if import.account.present? %> <%= import.account.name + " " %> <% end %> <%= t(".label", type: import.type.titleize, datetime: import.updated_at.strftime("%b %-d, %Y at %l:%M %p")) %> <% end %> <% if import.pending? %> <%= t(".in_progress") %> <% elsif import.importing? %> <%= t(".uploading") %> <% elsif import.failed? %> <%= t(".failed") %> <% elsif import.reverting? %> <%= t(".reverting") %> <% elsif import.revert_failed? %> <%= t(".revert_failed") %> <% elsif import.complete? %> <%= t(".complete") %> <% end %>
<% if import.complete? || import.revert_failed? %> <%= button_to revert_import_path(import), method: :put, class: "flex items-center gap-2 text-orange-500 hover:text-orange-600", data: { turbo_confirm: "This will delete transactions that were imported, but you will still be able to review and re-import your data at any time." } do %> <%= icon "rotate-ccw", class: "w-5 h-5 text-destructive" %> <% end %> <% else %> <%= button_to import_path(import), method: :delete, class: "flex items-center gap-2 text-destructive hover:text-destructive-hover", data: { turbo_confirm: CustomConfirm.for_resource_deletion("import") } do %> <%= icon "trash-2", class: "w-5 h-5 text-destructive" %> <% end %> <% end %> <%= link_to import_path(import), class: "flex items-center gap-2 text-primary hover:text-primary-hover" do %> <%= icon "eye", class: "w-5 h-5" %> <% end %>