<%# locals: (goal:, linkable_accounts:) %>
" data-goal-stepper-summary-no-date-value="<%= t("goals.form_stepper.step2.review.summary_no_date") %>" data-goal-stepper-account-count-one-value="<%= t("goals.form_stepper.step2.review.account_count.one") %>" data-goal-stepper-account-count-other-value="<%= t("goals.form_stepper.step2.review.account_count.other") %>" data-goal-stepper-suggested-with-date-value="<%= t("goals.form_stepper.step2.review.suggested_with_date") %>" data-goal-stepper-suggested-no-date-value="<%= t("goals.form_stepper.step2.review.suggested_no_date") %>"> <% if goal.errors[:base].any? %> <%= render "shared/form_errors", model: goal %> <% end %> <%# Connected stepper %>
1 <%= t("goals.form_stepper.step1.label") %>
2 <%= t("goals.form_stepper.step2.label") %>
<%= styled_form_with model: goal, url: goals_path, class: "space-y-4", data: { action: "keydown.enter->goal-stepper#blockEnter" } do |f| %>

<%= t("goals.form_stepper.step1.heading") %>

<%= t("goals.form_stepper.step1.subheading") %>

<%= render "color_picker", form: f, colors: Goal::COLORS, icons: Goal::ICONS %>
<%= f.text_field :name, placeholder: t("goals.form_stepper.step1.fields.name_placeholder"), autofocus: true, label: t("goals.form_stepper.step1.fields.name"), data: { goal_stepper_target: "nameInput", action: "input->goal-stepper#nameChanged" } %>
<%= f.money_field :target_amount, label: t("goals.form_stepper.step1.fields.target_amount"), hide_currency: true, amount_data: { goal_stepper_target: "amountInput", action: "input->goal-stepper#amountChanged" } %>
<%= f.date_field :target_date, label: t("goals.form_stepper.step1.fields.target_date") %>
<%= t("goals.form_stepper.step1.fields.funding_accounts") %>

<%= t("goals.form_stepper.step1.fields.funding_accounts_hint") %>

<% grouped = linkable_accounts.group_by { |a| a.subtype.to_s.presence || "other" } %> <% grouped.each_with_index do |(subtype, accts), group_idx| %>
<%= t("goals.form_stepper.step1.subtypes.#{subtype}", default: subtype.titleize) %>
"> <% accts.each_with_index do |account, idx| %> <% end %>
<% end %>
<%= render DS::Disclosure.new(title: t("goals.form_stepper.step1.fields.notes_summary"), align: "right") do %> <%= f.text_area :notes, label: t("goals.form_stepper.step1.fields.notes"), rows: 3, placeholder: t("goals.form_stepper.step1.fields.notes_placeholder") %> <% end %>
<%= render DS::Button.new( text: t("goals.form_stepper.continue"), variant: "primary", icon: "arrow-right", icon_position: :right, data: { goal_stepper_target: "footerRightButton", action: "click->goal-stepper#footerRight" } ) %>
<% end %>