2024-10-01 10:47:59 -04:00
|
|
|
<div id="<%= dom_id import %>" class="flex items-center justify-between mx-4 py-4 border-b last:border-b-0 border-alpha-black-50">
|
2024-05-17 09:09:32 -04:00
|
|
|
|
2024-10-01 10:47:59 -04:00
|
|
|
<div class="flex items-center gap-2 mb-1">
|
|
|
|
<%= link_to import_path(import), class: "text-sm text-gray-900 hover:underline" do %>
|
|
|
|
<%= t(".label", type: import.type.titleize, datetime: import.updated_at.strftime("%b %-d, %Y at %l:%M %p")) %>
|
|
|
|
<% end %>
|
2024-05-17 09:09:32 -04:00
|
|
|
|
2024-10-01 10:47:59 -04:00
|
|
|
<% if import.pending? %>
|
|
|
|
<span class="px-1 py text-xs rounded-full bg-gray-500/5 text-gray-500 border border-alpha-black-50">
|
|
|
|
<%= t(".in_progress") %>
|
|
|
|
</span>
|
|
|
|
<% elsif import.importing? %>
|
|
|
|
<span class="px-1 py text-xs animate-pulse rounded-full bg-orange-500/5 text-orange-500 border border-alpha-black-50">
|
|
|
|
<%= t(".uploading") %>
|
|
|
|
</span>
|
|
|
|
<% elsif import.failed? %>
|
|
|
|
<span class="px-1 py text-xs rounded-full bg-red-500/5 text-red-500 border border-alpha-black-50">
|
|
|
|
<%= t(".failed") %>
|
|
|
|
</span>
|
|
|
|
<% elsif import.complete? %>
|
|
|
|
<span class="px-1 py text-xs rounded-full bg-green-500/5 text-green-500 border border-alpha-black-50">
|
|
|
|
<%= t(".complete") %>
|
|
|
|
</span>
|
2024-05-17 09:09:32 -04:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
2024-10-01 10:47:59 -04:00
|
|
|
<%= contextual_menu do %>
|
|
|
|
<div class="w-48 p-1 text-sm leading-6 text-gray-900 bg-white shadow-lg shrink rounded-xl ring-1 ring-gray-900/5">
|
|
|
|
<%= link_to import_path(import),
|
2024-05-17 09:09:32 -04:00
|
|
|
class: "block w-full py-2 px-3 space-x-2 text-gray-900 hover:bg-gray-50 flex items-center rounded-lg" do %>
|
2024-10-01 10:47:59 -04:00
|
|
|
<%= lucide_icon "eye", class: "w-5 h-5 text-gray-500" %>
|
2024-05-17 09:09:32 -04:00
|
|
|
|
2024-10-01 10:47:59 -04:00
|
|
|
<span><%= t(".view") %></span>
|
|
|
|
<% end %>
|
2024-05-17 09:09:32 -04:00
|
|
|
|
2024-10-01 10:47:59 -04:00
|
|
|
<% unless import.complete? %>
|
2024-05-17 09:09:32 -04:00
|
|
|
<%= button_to import_path(import),
|
|
|
|
method: :delete,
|
|
|
|
class: "block w-full py-2 px-3 space-x-2 text-red-600 hover:bg-red-50 flex items-center rounded-lg",
|
|
|
|
data: { turbo_confirm: true } do %>
|
|
|
|
<%= lucide_icon "trash-2", class: "w-5 h-5" %>
|
|
|
|
|
|
|
|
<span><%= t(".delete") %></span>
|
|
|
|
<% end %>
|
2024-10-01 10:47:59 -04:00
|
|
|
<% end %>
|
|
|
|
</div>
|
2024-05-17 09:09:32 -04:00
|
|
|
<% end %>
|
|
|
|
</div>
|