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

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

<% if @counts["all"].zero? %> <%= render "empty_state", linkable_account_count: @linkable_account_count %> <% else %> <%# KPI strip %>
<%# Velocity %>

<%= t(".kpi.velocity_label") %>

<%= @kpi[:velocity_30d_sign] %><%= @kpi[:velocity_30d_money].format %>

<% if @kpi[:velocity_direction] == :flat %>

<% if @kpi[:velocity_prior_30d_money].zero? && @kpi[:velocity_30d_money].zero? %> <%= t(".kpi.velocity_delta_zero_base") %> <% else %> <%= t(".kpi.velocity_delta_flat") %> <% end %>

<% elsif @kpi[:velocity_delta_percent].nil? %>

<%= t(".kpi.velocity_delta_zero_base") %>

<% else %>

mt-1 tabular-nums"> <%= t(".kpi.velocity_delta_#{@kpi[:velocity_direction]}", percent: @kpi[:velocity_delta_percent].abs) %>

<% end %>
<%# Needs this month %>

<%= t(".kpi.needs_this_month_label") %>

<%= @kpi[:needs_this_month_money].format %>

<% if @kpi[:behind_count].zero? %> <%= t(".kpi.needs_this_month_zero_sub") %> <% else %> <%= t(".kpi.needs_this_month_sub", count: @kpi[:behind_count]) %> <% end %>

<%# On-track count %>

<%= t(".kpi.on_track_label") %>

<%= t(".kpi.on_track_value", on_track: @kpi[:on_track_count], total: @kpi[:active_total]) %>

<% parts = [] parts << t(".kpi.on_track_sub_parts.behind", count: @kpi[:behind_count]) if @kpi[:behind_count].positive? parts << t(".kpi.on_track_sub_parts.no_date", count: @kpi[:no_date_count]) if @kpi[:no_date_count].positive? parts << t(".kpi.on_track_sub_parts.paused", count: @kpi[:paused_count]) if @kpi[:paused_count].positive? %> <% if parts.any? %> <%= parts.join(" · ") %> <% else %> <%= t(".kpi.on_track_sub_all_good") %> <% end %>

<%# Goals section %>
" data-goals-filter-empty-filter-value="<%= t(".search.empty_with_filter") %>" data-goals-filter-empty-both-value="<%= t(".search.empty_with_both", query: "__QUERY__") %>" data-goals-filter-empty-default-value="<%= t(".search.empty") %>"> <% if @linkable_account_count > 0 %>
<%= render DS::Link.new( text: t(".new_goal"), variant: "primary", href: new_goal_path, icon: "plus", frame: :modal ) %>
<% end %> <% if @show_search %>
" placeholder="<%= t(".search.placeholder") %>" class="block w-full border border-secondary rounded-md py-2.5 pl-10 pr-3 bg-container focus:ring-gray-500 sm:text-sm">
<%= icon "search", class: "text-secondary" %>
<% %w[all on_track behind no_target_date paused].each do |status| %> <% active = status == "all" %> <% end %>
<% end %> <% if @active_goals.any? %>
<%= t(".ongoing_section.heading") %> · <%= @active_goals.size %>
<% @active_goals.each do |goal| %> <%= render Goals::CardComponent.new(goal: goal) %> <% end %>
<% else %>

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

<% end %>
<% if @completed_goals.any? %>
<%= t(".completed_section.heading") %> · <%= @completed_goals.size %>
<% @completed_goals.each do |goal| %> <%= render Goals::CardComponent.new(goal: goal) %> <% end %>
<% end %> <% if @archived_goals.any? %>
<%= icon("chevron-right", size: "sm") %> <%= t(".archived_section.heading") %> · <%= @archived_goals.size %>
<% @archived_goals.each do |goal| %> <%= render Goals::CardComponent.new(goal: goal) %> <% end %>
<% end %> <% end %>