<% if ENV["HOSTING_PLATFORM"] == "render" %>
  <div>
    <h2 class="font-medium mb-1"><%= t(".title") %></h2>
    <p class="text-gray-500 text-sm mb-4"><%= t(".description") %></p>

    <%= styled_form_with model: Setting.new, url: settings_hosting_path, method: :patch, data: { controller: "auto-submit-form", "auto-submit-form-trigger-event-value" => "blur" } do |form| %>
      <div class="space-y-4">
        <div class="flex items-center gap-4">
          <%= form.radio_button :upgrades_setting, "manual", checked: Setting.upgrades_mode == "manual", data: { "auto-submit-form-target" => "auto", "autosubmit-trigger-event": "input" } %>
          <%= form.label :upgrades_mode_manual, t(".manual_title"), class: "text-gray-900 text-sm" do %>
            <span class="font-medium"><%= t(".manual_title") %></span>
            <br>
            <span class="text-gray-500">
              <%= t(".manual_description") %>
            </span>
          <% end %>
        </div>
        <div class="flex items-center gap-4">
          <%= form.radio_button :upgrades_setting, "release", checked: Setting.upgrades_mode == "auto" && Setting.upgrades_target == "release", data: { "auto-submit-form-target" => "auto", "autosubmit-trigger-event": "input" } %>
          <%= form.label :upgrades_mode_release, t(".latest_release_title"), class: "text-gray-900 text-sm" do %>
            <span class="font-medium"><%= t(".latest_release_title") %></span>
            <br>
            <span class="text-gray-500">
              <%= t(".latest_release_description") %>
            </span>
          <% end %>
        </div>
        <div class="flex items-center gap-4">
          <%= form.radio_button :upgrades_setting, "commit", checked: Setting.upgrades_mode == "auto" && Setting.upgrades_target == "commit", data: { "auto-submit-form-target" => "auto", "autosubmit-trigger-event": "input" } %>
          <%= form.label :upgrades_mode_commit, t(".latest_commit_title"), class: "text-gray-900 text-sm" do %>
            <span class="font-medium"><%= t(".latest_commit_title") %></span>
            <br>
            <span class="text-gray-500">
              <%= t(".latest_commit_description") %>
            </span>
          <% end %>
        </div>
      </div>
    <% end %>
  </div>
<% end %>
