<%# locals: (entry:) %>
<%= tag.header class: "mb-4 space-y-1" do %> <% label = entry.trade.investment_activity_label %> <% income_trade = %w[Dividend Interest].include?(label) %> <% if income_trade %> <%= t(".#{label.downcase}") %> <% else %> <%= entry.amount.positive? ? t(".buy") : t(".sell") %> <% end %>

<%= format_money(income_trade ? entry.amount_money.abs : entry.amount_money) %> <%= entry.currency %>

<% if entry.linked? %> "> <%= icon("refresh-ccw", size: "sm") %> <% end %>
<%= I18n.l(entry.date, format: :long) %> <% end %> <% trade = entry.trade %> <% unless trade.security.cash? %>
<%= render DS::Disclosure.new(title: t(".overview"), open: true) do %>
<%= t(".symbol_label") %>
<%= trade.security.ticker %>
<% if trade.qty.positive? %>
<%= t(".purchase_qty_label") %>
<%= trade.qty.abs %>
<%= t(".purchase_price_label") %>
<%= format_money trade.price_money %>
<% end %> <% if trade.qty.positive? && trade.security.current_price.present? %>
<%= t(".current_market_price_label") %>
<%= format_money trade.security.current_price %>
<% end %> <% if trade.qty.positive? && trade.unrealized_gain_loss.present? %>
<%= t(".total_return_label") %>
<%= render "shared/trend_change", trend: trade.unrealized_gain_loss %>
<% end %>
<% end %>
<% end %>