<%# locals: (entry:, selectable: true, editable: true, short: false, show_tags: false, **opts) %> <% transaction, account = entry.account_transaction, entry.account %>
<% name_col_span = unconfirmed_transfer?(entry) ? "col-span-10" : short ? "col-span-6" : "col-span-4" %>
<% if selectable %> <%= check_box_tag dom_id(entry, "selection"), class: "maybe-checkbox maybe-checkbox--light", data: { id: entry.id, "bulk-select-target": "row", action: "bulk-select#toggleRowSelection" } %> <% end %>
<%= content_tag :div, class: ["flex items-center gap-2"] do %>
<%= entry_name(entry).first.upcase %>
<% if entry.new_record? %> <%= content_tag :p, entry.name %> <% else %> <%= link_to entry_name(entry), account_entry_path(account, entry), data: { turbo_frame: "drawer", turbo_prefetch: false }, class: "hover:underline hover:text-gray-800" %> <% end %>
<% end %>
<% if unconfirmed_transfer?(entry) %> <% if editable %> <%= form_with url: unmark_transfers_transactions_path, class: "flex items-center", data: { turbo_confirm: { title: t(".remove_transfer"), body: t(".remove_transfer_body"), accept: t(".remove_transfer_confirm"), }, turbo_frame: "_top" } do |f| %> <%= f.hidden_field "bulk_update[entry_ids][]", value: entry.id %> <%= f.button class: "flex items-center justify-center group", title: "Remove transfer" do %> <%= lucide_icon "arrow-left-right", class: "group-hover:hidden text-gray-500 w-4 h-4" %> <%= lucide_icon "unlink", class: "hidden group-hover:inline-block text-gray-900 w-4 h-4" %> <% end %> <% end %> <% else %> <%= lucide_icon "arrow-left-right", class: "text-gray-500 w-4 h-4" %> <% end %> <% end %>
<% unless entry.marked_as_transfer? %> <% unless short %>
"> <% if editable %> <%= render "categories/menu", transaction: transaction %> <% else %> <%= render "categories/badge", category: transaction.category %> <% end %> <% if show_tags %> <% transaction.tags.each do |tag| %> <%= render partial: "tags/badge", locals: { tag: tag } %> <% end %> <% end %>
<% end %> <% unless show_tags %> <%= tag.div class: short ? "col-span-4" : "col-span-3" do %> <% if entry.new_record? %> <%= tag.p account.name %> <% else %> <%= link_to account.name, account_path(account, tab: "transactions"), data: { turbo_frame: "_top" }, class: "hover:underline" %> <% end %> <% end %> <% end %> <% end %>
<%= content_tag :p, format_money(-entry.amount_money), class: ["text-green-600": entry.inflow?] %>