%= render HeaderComponent.new(title: "Donations") %>
<%= render MainSimpleComponent.new do %>
No donations yet.
Recent Donations
<%== pagy_nav @pagy %>
<% else %>
<% @donations.each do |donation| %>
User
Amount BTC
in EUR
in USD
Public name
Date
<% end %>
<%= link_to donation.user.address, admin_user_path(donation.user.address), class: 'ks-text-link' %>
<%= sats_to_btc donation.amount_sats %>
<% if donation.amount_eur.present? %><%= number_to_currency donation.amount_eur / 100, unit: "" %><% end %>
<% if donation.amount_usd.present? %><%= number_to_currency donation.amount_usd / 100, unit: "" %><% end %>
<%= donation.public_name %>
<%= donation.paid_at ? donation.paid_at.strftime("%Y-%m-%d (%H:%M UTC)") : "" %>
<%= link_to 'Show', admin_donation_path(donation), class: 'btn btn-sm btn-gray' %>
<%= link_to 'Edit', edit_admin_donation_path(donation), class: 'btn btn-sm btn-gray' %>
<%= link_to 'Destroy', admin_donation_path(donation), class: 'btn btn-sm btn-red',
data: { turbo_method: :delete, turbo_confirm: 'Are you sure?' } %>
<%= link_to 'Record an out-of-system donation', new_admin_donation_path, class: 'btn-md btn-gray' %>
<% end %>