2024-06-13 14:37:27 -04:00
|
|
|
<%# locals: (accounts:) %>
|
|
|
|
|
2024-11-15 13:49:37 -05:00
|
|
|
<% accounts.group_by(&:accountable_type).sort_by { |group, _| group }.each do |group, accounts| %>
|
2024-06-13 14:37:27 -04:00
|
|
|
<div class="bg-gray-25 p-1 rounded-xl">
|
|
|
|
<div class="flex items-center px-4 py-2 text-xs font-medium text-gray-500">
|
|
|
|
<p><%= to_accountable_title(Accountable.from_type(group)) %></p>
|
|
|
|
<span class="text-gray-400 mx-2">·</span>
|
|
|
|
<p><%= accounts.count %></p>
|
2024-06-24 16:56:44 +02:00
|
|
|
<p class="ml-auto"><%= totals_by_currency(collection: accounts, money_method: :balance_money) %></p>
|
2024-06-13 14:37:27 -04:00
|
|
|
</div>
|
|
|
|
<div class="bg-white">
|
|
|
|
<% accounts.each do |account| %>
|
|
|
|
<%= render account %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|