<%= styled_label_tag("custom_action_actions_#{action.key}", action.human_name, class: '-top') %>
<% input_name = "custom_action[actions][#{action.key}]" %>
<% if %i(associated_property boolean).include?(action.type) %>
<% selected_values = action.values
select_options = action.allowed_values.map { |v| { label: v[:label], value: v[:value], selected: selected_values.include?(v[:value]) } } %>
<% elsif %i(date_property).include?(action.type) %>
<% date = action.values.first %>
<%= tag 'custom-date-action-admin', data: { 'field-value': date.try(:iso8601) || date, 'field-name': input_name } %>
<% elsif %i(string_property text_property).include?(action.type) %>
<%= styled_text_field_tag input_name,
action.values,
container_class: '-slim',
step: 'any' %>
<% elsif action.type == :float_property %>
<%= styled_number_field_tag input_name,
action.values,
container_class: '-slim',
min: action.minimum,
max: action.maximum,
step: 'any' %>
<% elsif action.type == :integer_property %>
<%= styled_number_field_tag input_name,
action.values,
container_class: '-slim',
min: action.minimum,
max: action.maximum,
step: 1 %>
<% end %>