<%= turbo_frame_tag condition.benefit, "new_condition" do %>
<div class="card bg-light mb-3">
  <div class="card-header">
    <%= t(:add_condition, scope: :solidus_promotions) %>
  </div>
  <div class="card-body">
    <%= render 'solidus_promotions/admin/conditions/type_select', benefit: condition.benefit %>
    <% flash.each do |severity, message| %>
      <%= content_tag(:div, "", data: { controller: :flash, severity: severity, message: message }) %>
    <% end %>
    <% if condition.valid? %>
      <%= form_with model: condition, scope: "condition", url: solidus_promotions.admin_promotion_benefit_conditions_path(@promotion, condition.benefit), data: { turbo: false } do |form| %>
        <%= hidden_field_tag "condition[type]", condition.class.name %>
        <%= render condition, condition: condition, param_prefix: "condition", form: form %>

        <div class="row">
          <div class="col-12">
            <%= form.submit(t(:add, scope: [:solidus_promotions, :crud]), class: "btn btn-secondary float-right") %>
          </div>
        </div>

      <% end %>
    <% end %>
  </div>
</div>
<% end %>
