<%= render 'shared/turbo_modal', title: t('webhook_secret') do %>
  <%= form_for @webhook_url, url: webhook_secret_path, method: :patch, html: { class: 'space-y-4' }, data: { turbo_frame: :_top } do |f| %>
    <div class="space-y-2">
      <%= f.fields_for :secret, Struct.new(:key, :value).new(*@webhook_url.secret.to_a.first) do |ff| %>
        <div class="form-control">
          <%= ff.label :key, t('key'), class: 'label' %>
          <%= ff.text_field :key, class: 'base-input', placeholder: 'X-Example-Header' %>
        </div>
        <div class="form-control">
          <%= ff.label :value, t('value'), class: 'label' %>
          <%= ff.text_field :value, class: 'base-input' %>
        </div>
      <% end %>
    </div>
    <div class="form-control pt-2">
      <%= f.button button_title, class: 'base-button' %>
    </div>
  <% end %>
<% end %>
