<% if self_hosted? %> <% if Current.family&.synth_overage? %> <% elsif !Current.family&.synth_valid? %> <% end %> <% end %>

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

<%= Current.user.first_name.present? ? t(".greeting", name: Current.user.first_name ) : t(".fallback_greeting") %>

<% unless @accounts.blank? %>

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

<% end %>
<%= contextual_menu do %>
<%= contextual_menu_modal_action_item t(".import"), new_import_path, icon: "hard-drive-upload" %>
<% end %> <%= link_to new_account_path, class: "flex items-center gap-1 btn btn--primary", data: { turbo_frame: "modal" } do %> <%= lucide_icon("plus", class: "w-5 h-5") %> <%= t(".new") %> <% end %>
<% if @accounts.empty? %> <%= render "shared/no_account_empty_state" %> <% else %>
<%= render partial: "shared/value_heading", locals: { label: t(".net_worth"), period: @period, value: Current.family.net_worth, trend: @net_worth_series.trend } %>
<%= form_with url: root_path, method: :get, class: "flex items-center gap-4", data: { controller: "auto-submit-form" } do |form| %> <%= period_select form: form, selected: @period.name %> <% end %>
<%= render partial: "pages/dashboard/net_worth_chart", locals: { series: @net_worth_series } %>
<%= render partial: "pages/dashboard/allocation_chart", locals: { account_groups: @account_groups } %>
<%= render partial: "shared/value_heading", locals: { label: t(".income"), period: Period.last_30_days, value: @income_series.last&.value, trend: @income_series.trend } %>
<% @top_earners.first(3).each do |account| %> <%= link_to account, class: "border border-alpha-black-25 rounded-full p-1 pr-2 flex items-center gap-1 text-xs text-gray-900 font-medium hover:bg-gray-25", data: { controller: "tooltip" } do %> <%= render "accounts/logo", account: account, size: "sm" %> +<%= Money.new(account.income, account.currency) %> <%= render partial: "shared/text_tooltip", locals: { tooltip_text: account.name } %> <% end %> <% end %> <% if @top_earners.count > 3 %>
+<%= @top_earners.count - 3 %>
<% end %>
<%= render partial: "shared/value_heading", locals: { label: t(".spending"), period: Period.last_30_days, value: @spending_series.last&.value, trend: @spending_series.trend } %>
<% @top_spenders.first(3).each do |account| %> <%= link_to account, class: "border border-alpha-black-25 rounded-full p-1 pr-2 flex items-center gap-1 text-xs text-gray-900 font-medium hover:bg-gray-25", data: { controller: "tooltip" } do %> <%= render "accounts/logo", account: account, size: "sm" %> -<%= Money.new(account.spending, account.currency) %> <%= render partial: "shared/text_tooltip", locals: { tooltip_text: account.name } %> <% end %> <% end %> <% if @top_spenders.count > 3 %>
+<%= @top_spenders.count - 3 %>
<% end %>
<%= render partial: "shared/value_heading", locals: { label: t(".savings_rate"), period: Period.last_30_days, value: @savings_rate_series.last&.value, trend: @savings_rate_series.trend, is_percentage: true } %>
<% @top_savers.first(3).each do |account| %> <% unless account.savings_rate.infinite? %> <%= link_to account, class: "border border-alpha-black-25 rounded-full p-1 pr-2 flex items-center gap-1 text-xs text-gray-900 font-medium hover:bg-gray-25", data: { controller: "tooltip" } do %> <%= render "accounts/logo", account: account, size: "sm" %> <%= account.savings_rate > 0 ? "+" : "-" %><%= number_to_percentage(account.savings_rate.abs * 100, precision: 2) %> <%= render partial: "shared/text_tooltip", locals: { tooltip_text: account.name } %> <% end %> <% end %> <% end %> <% if @top_savers.count > 3 %>
+<%= @top_savers.count - 3 %>
<% end %>
<%= render partial: "shared/value_heading", locals: { label: t(".investing"), period: @period, value: @investing_series.last.value, trend: @investing_series.trend } %>

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

<% if @transaction_entries.empty? %>

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

<% else %>
<%= entries_by_date(@transaction_entries, selectable: false) do |entries| %> <%= render entries, selectable: false %> <% end %>

<%= link_to t(".view_all"), transactions_path %>

<% end %>
<% end %>