<% align = field.dig('preferences', 'align') %> <% if field['type'].in?(['signature', 'image', 'initials', 'stamp']) %> <% elsif field['type'].in?(['file', 'payment']) %>
<% Array.wrap(value).each do |val| %> <%= svg_icon('paperclip', class: 'inline w-[1.5vw] h-[1.5vw] lg:w-4 lg:h-4') %> <%= attachments_index[val].filename %> <% end %>
<% elsif field['type'] == 'checkbox' %>
<%= svg_icon('check', class: "aspect-square #{area['w'] > area['h'] ? '!w-auto !h-full' : '!w-full !h-auto'}") %>
<% elsif field['type'].in?(%w[multiple radio]) && area['option_uuid'] %> <% option = field['options']&.find { |o| o['uuid'] == area['option_uuid'] } %> <% option_name = option['value'].presence || "Option #{field['options'].index(option) + 1}" %> <% if option && Array.wrap(value).include?(option_name) %>
<%= svg_icon('check', class: "aspect-square #{area['w'] > area['h'] ? '!w-auto !h-full' : '!w-full !h-auto'}") %>
<% end %> <% elsif field['type'] == 'cells' && area['cell_w'] %> <% cell_width = area['cell_w'] / area['w'] * 100 %>
<% (0..(area['w'] / area['cell_w']).ceil).each do |index| %> <% if value[index] %>
<%= value[index] %>
<% end %> <% end %>
<% elsif field['type'] == 'date' %>
<% value = Time.current.in_time_zone(local_assigns[:timezone]).to_date.to_s if value == '{{date}}' %> <%= TimeUtils.format_date_string(value, field.dig('preferences', 'format'), local_assigns[:locale]) %>
<% elsif field['type'] == 'number' %>
<%= NumberUtils.format_number(value, field.dig('preferences', 'format')) %>
<% else %>
<%= Array.wrap(value).join(', ') %>
<% end %>