<%# locals: (account:, title: nil, tooltip: nil, **args) %> <% period = params[:period] ? Period.from_key(params[:period]) : Period.last_30_days %> <% default_value_title = account.asset? ? t(".balance") : t(".owed") %>
<%= tag.p title || default_value_title, class: "text-sm font-medium text-secondary" %> <%= tooltip %>
<%= tag.p format_money(account.balance_money), class: "text-primary text-3xl font-medium" %>
<%= form_with url: request.path, method: :get, data: { controller: "auto-submit-form" } do |form| %> <%= period_select form: form, selected: period %> <% end %>
<%= turbo_frame_tag dom_id(account, :chart_details), src: chart_account_path(account, period: period.key) do %> <%= render "accounts/chart_loader" %> <% end %>