2024-08-23 08:47:08 -04:00
<%# locals: (account:, url:) %>
2025-07-03 09:33:07 -04:00
<% if @error_message.present? %>
2025-07-08 10:25:16 -04:00
<div class="mb-4">
<%= render AlertComponent.new(message: @error_message, variant: :error) %>
</div>
2025-07-03 09:33:07 -04:00
<% end %>
2025-07-08 10:25:16 -04:00
<%= styled_form_with model: account, url: url, scope: :account, class: "flex flex-col gap-4 justify-between grow text-primary" do |form| %>
2024-08-23 08:47:08 -04:00
<div class="grow space-y-2">
2024-11-04 20:27:31 -05:00
<%= form.hidden_field :accountable_type %>
<%= form.hidden_field :return_to, value: params[:return_to] %>
2024-10-10 11:43:28 -04:00
2024-11-04 20:27:31 -05:00
<%= form.text_field :name, placeholder: t(".name_placeholder"), required: "required", label: t(".name_label") %>
2025-05-07 13:56:20 -04:00
<% unless account.linked? %>
2025-07-08 13:03:40 -04:00
<%= form.money_field :balance,
label: t(".balance"),
required: true,
2025-07-08 10:25:16 -04:00
default_currency: Current.family.currency,
label_tooltip: "The current balance or value of the account, which is typically the balance reported by your financial institution." %>
<% unless account.persisted? %>
2025-07-08 13:03:40 -04:00
<%= form.date_field :tracking_start_date,
label: "Tracking start date",
required: true,
value: 2.years.ago.to_date,
2025-07-08 10:25:16 -04:00
label_tooltip: "The date we will start tracking the balance for this account. If you're not sure, we recommend using the default of 2 years ago so net worth graphs have adequate historical data." %>
<% end %>
2025-05-07 13:56:20 -04:00
<% end %>
2024-08-23 08:47:08 -04:00
2024-11-04 20:27:31 -05:00
<%= yield form %>
2024-08-23 08:47:08 -04:00
</div>
2024-11-04 20:27:31 -05:00
<%= form.submit %>
2024-08-23 08:47:08 -04:00
<% end %>