<%= render DS::Dialog.new(reload_on_close: params[:reload_on_close].present?) do |dialog| %> <% title = if @rule.name.present? t(".title_with_name", name: @rule.name) else t(".title") end %> <% dialog.with_header(title: title) %> <% dialog.with_body do %>

<%= t(".apply_notice_html", count: @rule.affected_resource_count, resource: @rule.resource_type.pluralize) %>

<% if @rule.actions.any? { |a| a.action_type == "auto_categorize" } %> <% affected_count = @rule.affected_resource_count %>
<%= icon "info", class: "w-4 h-4 text-blue-600 mt-0.5 flex-shrink-0" %>

<%= t(".ai_cost_title") %>

<% if @estimated_cost.present? %>

<%= t(".ai_cost_with_estimate_html", count: affected_count, cost: sprintf("%.4f", @estimated_cost)) %>

<% else %>

<%= t(".ai_cost_no_estimate_html", count: affected_count) %> <% if @selected_model.present? %> <%= t(".cost_unavailable_model", model: @selected_model) %> <% else %> <%= t(".cost_unavailable_no_provider") %> <% end %> <%= t(".cost_warning") %>

<% end %>

<%= link_to t(".view_usage_history"), settings_llm_usage_path, class: "underline hover:text-blue-800" %>

<% end %> <%= render DS::Button.new( text: t(".confirm_changes"), href: apply_rule_path(@rule), method: :post, full_width: true, data: { turbo_frame: "_top" }) %> <% end %> <% end %>