<%= content_for :page_title, "Bank Sync Providers" %>

<div class="space-y-8">
  <div>
    <p class="text-secondary mb-4">
      Configure credentials for third-party bank sync providers. Settings configured here will override environment variables.
    </p>
  </div>

  <% @provider_configurations.each do |config| %>
    <% next if config.provider_key.to_s.casecmp("simplefin").zero? %>
    <%= settings_section title: config.provider_key.titleize do %>
      <%= render "settings/providers/provider_form", configuration: config %>
    <% end %>
  <% end %>

  <%= settings_section title: "Lunch Flow" do %>
    <turbo-frame id="lunchflow-providers-panel">
      <%= render "settings/providers/lunchflow_panel" %>
    </turbo-frame>
  <% end %>

  <%= settings_section title: "SimpleFIN" do %>
    <turbo-frame id="simplefin-providers-panel">
      <%= render "settings/providers/simplefin_panel" %>
    </turbo-frame>
  <% end %>

</div>
