<%# locals: (entry:, selectable: true, balance_trend: nil) %> <% transaction, account = entry.account_transaction, entry.account %>
text-sm font-medium p-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 %> <% if entry.account_transaction.merchant&.icon_url %> <%= image_tag entry.account_transaction.merchant.icon_url, class: "w-6 h-6 rounded-full" %> <% else %> <%= render "shared/circle_logo", name: transaction.name, size: "sm" %> <% end %>
<% if entry.new_record? %> <%= content_tag :p, transaction.name %> <% else %> <%= link_to transaction.name, entry.transfer.present? ? account_transfer_path(entry.transfer) : account_entry_path(entry), data: { turbo_frame: "drawer", turbo_prefetch: false }, class: "hover:underline hover:text-gray-800" %> <% end %>
<% end %>
<% if unconfirmed_transfer?(entry) %> <%= render "account/transfers/transfer_toggle", entry: entry %> <% end %>
<% if entry.transfer.present? %> <% unless balance_trend %>
<% end %>
<%= render "account/transfers/account_logos", transfer: entry.transfer, outflow: entry.outflow? %>
<% else %>
<%= render "categories/menu", transaction: transaction %>
<% unless balance_trend %> <%= tag.div class: "col-span-2 overflow-hidden truncate" 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?] %>
<% if balance_trend %>
<% if balance_trend.trend %> <%= tag.p format_money(balance_trend.trend.current), class: "font-medium text-sm text-gray-900" %> <% else %> <%= tag.p "--", class: "font-medium text-sm text-gray-400" %> <% end %>
<% end %>