<%= 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 %>
<%= render DS::Menu.new do |menu| %> <% menu.with_item(variant: "link", text: t(".view"), href: import_path(import), icon: "eye") %> <% if import.complete? || import.revert_failed? %> <% menu.with_item( variant: "button", text: t(".revert"), href: revert_import_path(import), icon: "rotate-ccw", method: :put, confirm: CustomConfirm.new( title: "Revert import?", body: "This will delete transactions that were imported, but you will still be able to review and re-import your data at any time.", btn_text: "Revert" )) %> <% else %> <% menu.with_item( variant: "button", text: t(".delete"), href: import_path(import), icon: "trash-2", method: :delete, confirm: CustomConfirm.for_resource_deletion("import")) %> <% end %> <% end %>