Dashboard

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

<% unless @accounts.blank? %>

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

<% end %>
<%= link_to new_account_path, class: "flex text-white text-sm font-medium items-center gap-1 bg-gray-900 hover:bg-gray-700 rounded-lg p-2 pr-3", 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" do %> <%= image_tag account_logo_url(account), class: "w-5 h-5" %> +<%= Money.new(account.income, account.currency) %> <% 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" do %> <%= image_tag account_logo_url(account), class: "w-5 h-5" %> -<%= Money.new(account.spending, account.currency) %> <% 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| %> <%= 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" do %> <%= image_tag account_logo_url(account), class: "w-5 h-5" %> <%= account.savings_rate > 0 ? "+" : "-" %><%= number_to_percentage(account.savings_rate.abs * 100, precision: 2) %> <% 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, editable: false, short: true %> <% end %>

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

<% end %>

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

Coming soon...

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

Coming soon...

<% end %>