<%= render "spree/admin/shared/preference_fields/#{calculator.preference_type(:base_amount)}",
  name: "#{prefix}[calculator_attributes][preferred_base_amount]",
  value: calculator.preferred_base_amount, label: t('spree.base_amount') %>

<div class="field">
  <%= label_tag(
    "#{prefix}[calculator_attributes][preferred_currency]",
    t('spree.currency')
  ) %>
  <%= select_tag(
    "#{prefix}[calculator_attributes][preferred_currency]",
    options_for_select(
      Spree::Config.available_currencies,
      calculator.preferred_currency || Spree::Config[:currency]
    ),
    { class: 'custom-select fullwidth' }
  ) %>
</div>

<div class="field">
  <%= label_tag nil, t('spree.tiers') %>
  <div class="js-tiered-calculator">
    <%= content_tag :div, nil, class: "js-tiers", data: {
      'original-tiers' => Hash[calculator.preferred_tiers.sort],
      'form-prefix' => prefix,
      'calculator' => 'tiered_flat_rate'
    } %>
    <a class="button js-add-tier"><%= t('spree.actions.add') %></a>
  </div>
</div>
