<%# locals: (balance_sheet:) %>
<% balance_sheet.classification_groups.each do |classification_group| %>

<%= classification_group.display_name %>

<% if classification_group.account_groups.any? %>
<% classification_group.account_groups.each do |account_group| %>
<% end %>
<% classification_group.account_groups.each do |account_group| %>

<%= account_group.name %>

<%= number_to_percentage(account_group.weight, precision: 0) %>

<% end %>
Name

Weight

Value

<% classification_group.account_groups.each do |account_group| %>
<%= lucide_icon("chevron-right", class: "group-open:rotate-90 text-secondary w-5 h-5") %>

<%= account_group.name %>

<%= render partial: "shared/progress_circle", locals: { progress: account_group.weight, color: account_group.color } %>

<%= number_to_percentage(account_group.weight, precision: 0) %>

<%= format_money(account_group.total_money) %>

<% account_group.accounts.each_with_index do |account, idx| %>
<%= render "accounts/logo", account: account, size: "sm", color: account_group.color %> <%= link_to account.name, account_path(account) %>
<%= render partial: "shared/progress_circle", locals: { progress: account.weight, color: account_group.color } %>

<%= number_to_percentage(account.weight, precision: 0) %>

<%= format_money(account.balance_money) %>

<% if idx < account_group.accounts.size - 1 %>
<% end %> <% end %>
<% end %>
<% else %>
<%= lucide_icon classification_group.icon, class: "w-6 h-6 shrink-0 text-secondary" %>

No <%= classification_group.display_name %>

<%= "You have no #{classification_group.display_name}" %>

<% end %>
<% end %>