<%# locals: (group:, parent_visible:, over_budget_mode: false) %>

<% if parent_visible %>
  <div class="py-2">
    <%= render "budget_categories/budget_category",
      budget_category: group.budget_category,
      show_budget_meta: (over_budget_mode ? group.budget_category.over_budget_with_budget? : true) %>
  </div>
<% end %>

<% group.budget_subcategories.each do |budget_subcategory| %>
  <% if parent_visible %>
    <div class="py-2 w-full flex items-start">
      <div class="ml-8 pt-4 flex items-center justify-center text-subdued">
        <%= icon "corner-down-right" %>
      </div>
      <%= render "budget_categories/budget_category",
        budget_category: budget_subcategory,
        show_budget_meta: (over_budget_mode ? budget_subcategory.over_budget_with_budget? : true) %>
    </div>
  <% else %>
    <div class="py-2">
      <%= render "budget_categories/budget_category",
        budget_category: budget_subcategory,
        show_budget_meta: (over_budget_mode ? budget_subcategory.over_budget_with_budget? : true) %>
    </div>
  <% end %>
<% end %>
