%= render HeaderComponent.new(title: "Donations") %>
<%= render MainSimpleComponent.new do %>
No donations yet.
Recent Donations
<%== pagy_nav @pagy %>
<% else %>
<% @donations.each do |donation| %>
User
Sats
Fiat Amount
Public name
Date
<% end %>
<%= link_to donation.user.cn, admin_user_path(donation.user.cn), class: 'ks-text-link' %>
<% if donation.amount_sats.present? %><%= number_with_delimiter donation.amount_sats %><% end %>
<% if donation.fiat_amount.present? %><%= number_to_currency donation.fiat_amount.to_f / 100, unit: "" %> <%= donation.fiat_currency %><% 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 %>