"
data-no-confirmation="<%= @action.no_confirmation %>"
data-action-target="controllerDiv"
data-resource-name="<%= @resource.model_key %>"
data-resource-id="<%= params[:id] %>"
class="hidden text-slate-800"
>
<%= form_with scope: 'fields',
url: Avo::Services::URIService.parse(@resource.records_path).append_paths("actions").to_s,
local: true,
data: @action.class.form_data_attributes do |form|
%>
<%= render Avo::ModalComponent.new do |c| %>
<% c.with_heading do %>
<%= @action.action_name %>
<% end %>
<%= @action.get_message %>
<%= hidden_field_tag :action_id, @action.to_param %>
<%= form.hidden_field :avo_resource_ids, value: params[:id] || params[:resource_ids], 'data-action-target': 'resourceIds' %>
<%= form.hidden_field :avo_selected_query, 'data-action-target': 'selectedAllQuery' %>
<%= form.hidden_field :arguments, value: params[:arguments] %>
<% if @action.get_fields.present? %>
<% @action.get_fields.each_with_index do |field, index| %>
<%= render field
.hydrate(resource: @resource, record: @resource.record, user: @resource.user, view: @view, action: @action)
.component_for_view(@view)
.new(field: field, resource: @resource, index: index, form: form, compact: true)
%>
<% end %>
<% end %>
<% c.with_controls do %>
<%= a_button type: :button,
data: { action: 'click->modal#close' },
size: :sm,
color: :gray do %>
<%= @action.cancel_button_label %>
<% end %>
<%= a_button type: :submit,
color: :green,
style: :primary,
size: :sm,
data: {
target: :submit_action,
**@action.class.submit_button_data_attributes
} do %>
<%= @action.confirm_button_label %>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>