<% period = Period.from_param(params[:period]) %>
<%= render "accounts/summary/header" %>
<%= render partial: "shared/value_heading", locals: { label: "Assets", period: period, value: Current.family.assets, trend: @asset_series.trend } %>
<%= render partial: "shared/value_heading", locals: { label: "Liabilities", period: period, size: "md", value: Current.family.liabilities, trend: @liability_series.trend } %>

Assets

<%= link_to new_account_path, class: "btn btn--secondary flex items-center gap-1", data: { turbo_frame: "modal" } do %> <%= lucide_icon("plus", class: "w-5 h-5 text-gray-500") %>

<%= t(".new") %>

<% end %> <%= form_with url: summary_accounts_path, method: :get, data: { controller: "auto-submit-form" } do |form| %> <%= period_select form: form, selected: period.name %> <% end %>
<% if @account_groups[:assets].children.any? %> <%= render partial: "pages/account_percentages_bar", locals: { account_groups: @account_groups[:assets].children } %> <%= render partial: "pages/account_percentages_table", locals: { account_groups: @account_groups[:assets].children } %> <% else %>
<%= lucide_icon "blocks", class: "w-6 h-6 shrink-0 text-gray-500" %>

<%= t(".no_assets") %>

<%= t(".no_assets_description") %>

<% end %>

Liabilities

<%= link_to new_account_path, class: "btn btn--secondary flex items-center gap-1", data: { turbo_frame: "modal" } do %> <%= lucide_icon("plus", class: "w-5 h-5 text-gray-500") %>

<%= t(".new") %>

<% end %> <%= form_with url: summary_accounts_path, method: :get, data: { controller: "auto-submit-form" } do |form| %> <%= period_select form: form, selected: period.name %> <% end %>
<% if @account_groups[:liabilities].children.any? %> <%= render partial: "pages/account_percentages_bar", locals: { account_groups: @account_groups[:liabilities].children } %> <%= render partial: "pages/account_percentages_table", locals: { account_groups: @account_groups[:liabilities].children } %> <% else %>
<%= lucide_icon "scale", class: "w-6 h-6 shrink-0 text-gray-500" %>

<%= t(".no_liabilities") %>

<%= t(".no_liabilities_description") %>

<% end %>