<%= render 'shared/turbo_modal_large', title: t('quick_send') do %>
<% submitter_fields = @fields.select { |f| f['submitter_uuid'] == @submitters.first['uuid'] } %> <% auto_fillable = submitter_fields.all? { |f| f['default_value'].present? || !f['required'] || f['type'].in?(%w[signature initials stamp]) } %> <% if auto_fillable %>
<%= svg_icon('circle_check', class: 'w-5 h-5 stroke-current shrink-0') %> <%= t('all_fields_have_defaults') %>
<% else %>
<%= svg_icon('alert_circle', class: 'w-5 h-5 stroke-current shrink-0') %> <%= t('some_fields_require_manual_input') %>
<% end %> <% if submitter_fields.present? %>
<% submitter_fields.each do |field| %> <% end %>
<%= t('name') %> <%= t('type') %> <%= t('value') %>
<%= field['name'].presence || field['type'].humanize %> <%= field['type'] %> <% if field['default_value'].present? %> <%= truncate(Array(field['default_value']).join(', '), length: 40) %> <% elsif field['type'].in?(%w[signature initials stamp]) %> <%= t('filled_by_recipient') %> <% elsif !field['required'] %> <%= t('optional') %> <% else %> <%= t('required') %> <% end %>
<% end %> <%= form_for '', url: template_quick_send_path(@template), method: :post, html: { autocomplete: 'off' }, data: { turbo_frame: :_top } do |f| %>
<%= f.button button_title(title: t('send_now'), icon: svg_icon('send', class: 'w-5 h-5')), class: 'base-button' %>
<% end %>
<% end %>