<%# locals: (entry:, selectable: true, show_balance: false, origin: nil) %>

<% trade, account = entry.account_trade, entry.account %>

<div class="grid grid-cols-12 items-center text-gray-900 text-sm font-medium p-4">
  <div class="col-span-8 flex items-center gap-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 %>

    <div class="max-w-full">
      <%= tag.div class: ["flex items-center gap-2"] do %>
        <div class="flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-gray-600/5 text-gray-600">
          <%= trade.name.first.upcase %>
        </div>

        <div class="truncate text-gray-900">
          <% if entry.new_record? %>
            <%= content_tag :p, trade.name %>
          <% else %>
            <%= link_to trade.name,
                        account_entry_path(account, entry),
                        data: { turbo_frame: "drawer", turbo_prefetch: false },
                        class: "hover:underline hover:text-gray-800" %>
          <% end %>
        </div>
      <% end %>
    </div>
  </div>

  <div class="col-span-2 justify-self-end font-medium text-sm">
    <%= tag.span format_money(entry.amount_money) %>
  </div>

  <div class="col-span-2 justify-self-end">
    <%= tag.p "--", class: "font-medium text-sm text-gray-400" %>
  </div>
</div>
