<%= content_for :header_nav do %> <%= render "imports/nav", import: @import %> <% end %> <%= content_for :previous_path, imports_path %>

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

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

<% ["csv-paste-tab", "csv-upload-tab"].each do |tab| %> <%= tag.div id: tab, data: { tabs_target: "tab" }, class: tab == "csv-upload-tab" ? "hidden" : "" do %> <%= styled_form_with model: @import, scope: :import, url: import_upload_path(@import), multipart: true, class: "space-y-2" do |form| %> <%= form.select :col_sep, Import::SEPARATORS, label: true %> <% if @import.type == "TransactionImport" || @import.type == "TradeImport" %> <%= form.select :account_id, @import.family.accounts.pluck(:name, :id), { label: "Account (optional)", include_blank: "Multi-account import", selected: @import.account_id } %> <% end %> <% if tab == "csv-paste-tab" %> <%= form.text_area :raw_file_str, rows: 10, required: true, placeholder: "Paste your CSV file contents here", "data-auto-submit-form-target": "auto" %> <% else %> <% end %> <%= form.submit "Upload CSV", disabled: @import.complete? %> <% end %> <% end %> <% end %>
<%= lucide_icon("info", class: "w-5 h-5 shrink-0") %>

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

  • <%= t(".instructions_2") %>
  • <%= t(".instructions_3") %>
  • <%= t(".instructions_4") %>
  • <%= t(".instructions_5") %>
<%= render partial: "imports/table", locals: { headers: @import.csv_template.headers, rows: @import.csv_template } %>