<%= render DS::Dialog.new(frame: "drawer", responsive: true, auto_open: true) do |dialog| %>
  <% provider_key = @panel_key || @provider_configuration&.provider_key&.to_s %>
  <% dialog.with_header(custom_header: true) do %>
    <%= render "settings/providers/drawer_header", provider_key: provider_key, title: @panel_title %>
  <% end %>
  <% dialog.with_body do %>
    <% if @panel_partial %>
      <turbo-frame id="<%= @panel_key %>-connect-form" target="_top">
        <%= render "settings/providers/#{@panel_partial}" %>
      </turbo-frame>
    <% else %>
      <turbo-frame id="config-connect-form" target="_top">
        <%= render "settings/providers/provider_form", configuration: @provider_configuration %>
      </turbo-frame>
    <% end %>

    <p class="text-xs text-secondary mt-6 pt-3 border-t border-tertiary">
      <%= t("settings.providers.drawer_trust_statement") %>
    </p>
  <% end %>
<% end %>
