<ul class="list-none">
  <% donations.each do |donation| %>
    <li class="mb-8 grid gap-y-2 grid-cols-2 items-center">
      <h3 class="mb-0">
        <% if donation.completed? %>
        <%= donation.paid_at.strftime("%B %d, %Y") %>
        <% else %>
        <%= donation.created_at.strftime("%B %d, %Y") %>
        <% end %>
      </h3>
      <p class="row-span-2 font-mono text-right mb-0">
        <span class="text-xl">
          <%= number_with_delimiter donation.amount_sats %> sats
        </span>
        <br>
        <span class="text-sm text-gray-500">
          (~ <%= number_to_currency donation.fiat_amount.to_f / 100, unit: "" %> <%= donation.fiat_currency %>)
        </span>
      </p>
      <p class="mb-0 text-gray-500">
        <% if donation.processing? %>
          Waiting for confirmations
          <% if donation.donation_method == "btcpay" %>
            <%= link_to "check status", btcpay_checkout_url(donation.btcpay_invoice_id),
                  class: "ml-2 btn-sm btn-gray" %>
          <% end %>
        <% else %>
          <% if donation.public_name.present? %>
            As: <%= donation.public_name %>
          <% else %>
            Anonymous
          <% end %>
        <% end %>
      </p>
    </li>
  <% end %>
</ul>
