<%# locals: (balance_sheet:, period:, **args) %>
<% series = balance_sheet.net_worth_series(period: period) %>

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

<% if balance_sheet.syncing? %>
<% else %>

<%= series.current.format %>

<% if series.trend.nil? %>

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

<% else %> <%= render partial: "shared/trend_change", locals: { trend: series.trend, comparison_label: period.comparison_label } %> <% end %> <% end %>
<%= form_with url: root_path, method: :get, data: { controller: "auto-submit-form" } do |form| %> <%= form.select :period, Period.as_options, { selected: period.key }, data: { "auto-submit-form-target": "auto" }, class: "bg-container border border-secondary font-medium rounded-lg px-3 py-2 text-sm pr-7 cursor-pointer text-primary focus:outline-hidden focus:ring-0" %> <% end %>
<% if balance_sheet.syncing? %>
<% else %> <% if series.any? %>
<% else %>

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

<% end %> <% end %>