<%= render HeaderComponent.new(title: "Donations") %> <%= render MainSimpleComponent.new do %>
<%= render QuickstatsContainerComponent.new do %> <%= render QuickstatsItemComponent.new( type: :number, title: 'Overall', value: @stats[:overall_sats], unit: 'sats' ) %> <%= render QuickstatsItemComponent.new( type: :number, title: 'Donors', value: @stats[:donor_count], meta: "/ #{User.count} users" ) %> <% end %>
<%= form_with url: admin_donations_path, method: :get, local: true, class: "flex gap-1" do %> <%= text_field_tag :username, @username, placeholder: 'Filter by username' %> <%= button_tag type: 'submit', name: nil, title: "Filter", class: 'btn-md btn-icon btn-outline' do %> <%= render partial: "icons/filter", locals: { custom_class: "text-blue-600 h-4 w-4 inline" } %> <% end %> <% if @username %> <%= link_to admin_donations_path, title: "Remove filter", class: 'btn-md btn-icon btn-outline' do %> <%= render partial: "icons/x", locals: { custom_class: "text-red-600 h-4 w-4 inline" } %> <% end %> <% end %> <% end %>
<% if @pending_donations.present? %>

Pending

<%= render partial: "admin/donations/list", locals: { donations: @pending_donations } %>
<% end %>
<% if @donations.present? %>

Received

<%= render partial: "admin/donations/list", locals: { donations: @donations, pagy: @pagy } %> <% else %>

No donations received yet.

<% end %>

<%= link_to 'Record an out-of-system donation', new_admin_donation_path, class: 'btn-md btn-gray' %>

<% end %>