{{ attach_library('ui_patterns/routes_finder_block.routes_finder_block_lib') }}

{% set switch_attributes = switch_attributes|default(create_attribute())
  .setAttribute("id", 'routes-finder-switch')
%}

<div class="route-finder">
  <div class="top-section">
    {{ origin_field }}
    {{ destination_field }}
    {% include '@atoms/form/button/button.twig' with {
      'text': '<i class="fas fa-exchange"></i>',
      'value': 'find_routes',
      'btn_type': 'button',
      'status': 'default',
      'icon_position': 'left',
      'class': 'switch-places',
      'size': 'btn-sm',
      'attributes': switch_attributes
    } only %}
  </div>
  <div class="bottom-section">
    {{ submit }}
  </div>
  <div id="route-finder-error-message"></div>
</div>
{% if bottom_text %}
  {{ bottom_text }}
{% endif %}
