{# LIBRARIES #}
{% extends "@molecules/tm-bs/card/card.twig" %}

{# VARIABLES #}
{% set card_class = "destination-route-card cbelianr buy-tickets-btn" %}
{% set link_scope = "card" %}
{% set show_header = false %}
{% set show_footer = true %}
{% set hide_body_alt = true %}
{% set card_attributes = card_attributes|default(create_attribute()) %}
{% if crs_origin %}
  {% set card_attributes = card_attributes.setAttribute('data-from-station', crs_origin) %}
{% endif %}
{% if crs_destination %}
  {% set card_attributes = card_attributes.setAttribute('data-to-station', crs_destination) %}
{% endif %}
{% if crs_origin and crs_destination %}
  {% set card_attributes = card_attributes.setAttribute('data-autosubmit', '1') %}
{% endif %}


{# BLOCKS #}
{% block card_body %}

  {# Not happy with this, currently has to be in a block. Might beed libs block #}
  {{ attach_library('ui_patterns/destination_route_card.destination_route_card_lib') }}

  {% if title %}
    <h3 class="card-title">{{ title }}</h3>
  {% endif %}

{% endblock %}

{% block card_footer %}
  {% if time %}
    <span><i class="far fa-clock"></i> {{ time }}</span>
  {% endif %}
  {% if fare %}
    <span>From <span class="price">£{{ fare }}</span><i class="fas fa-chevron-right beli belir"></i></span>
  {% endif %}
{% endblock %}
