<%= if Mix.env == :dev do %>
<%= Jason.encode!(@opts, pretty: true) %>
<% end %> <%= form_for @opts, "#", [as: :opts, phx_change: :update_stage, phx_target: @myself], fn f -> %>
<%= select f, :stage, @stages, prompt: "Select a stage...", id: "#{@id}-stage", class: "form-select" %>
<% end %>

<%= @opts["stage"] %>

<% component = component_module(@opts["stage"]) %> <%= unless is_nil(component) do %> <%= live_component(@socket, component, index: @index, id: "#{@id}-conditional", stage: @stage, keypath: @keypath ++ ["opts"]) %> <% end %>
<%= if @opts["condition"]["mode"] in ["accept", "reject"] do %>

Condition: Filter

<%= if @confirm_convert_to_rule do %>

This will modify the conditional stage to only run when the first rule is met. Are you sure you want to proceed?

<% end %> <%= live_component @socket, FrenzyWeb.FilterLive, id: "##{@id}-filter", parent_id: @id, filter: @opts["condition"] %>
<% else %>

Condition: Rule

<%= live_component @socket, FrenzyWeb.FilterRuleLive, id: "##{@id}-rule", parent_id: @id, rule: @opts["condition"], index: :no_index %>
<% end %>