{# LIBRARIES #}
{{ attach_library('ui_patterns/more_less_cta.more_less_cta_lib') }}

{# VARIABLES #}
{% set title = title|default('Book in Advance - Pay Less') %}
{% set icon = icon|default('far fa-ticket') %}
{% set content = content|default(false) %}
{% set button_text = button_text|default('Book cheap tickets') %}
{% set button_url = button_url|default('#') %}
{% set button_class = button_class|default('buy-tickets-btn') %}
{% set more_str = more_str|default('MORE') %}
{% set less_str = less_str|default('LESS') %}
{% set button_attributes = button_attributes|default(create_attribute()) %}
{% set cat_list = cat_list|default([
  'No booking fees',
  'Unbeatable on price',
  'Buy in advance, pay less',
]) %}

{# TEMPLATE #}
<div class="ml-cta-wrapper">
  <div class="row">
    <div class="col-md-8 ml-cta">
      <div class="ml-cta-inner">
        {% if title %}
          <h2><i class="{{ icon }}"></i> {{ title }}</h2>
        {% endif %}
        {% if content %}
          {% include "@molecules/tm-bits/tm-bits-more-less.twig" with {
            "content": content,
            "more_str": more_str,
            "less_str": less_str,
          } only %}
        {% endif %}
      </div>
    </div>
    <div class="col-md-4 ml-btn">
      <div class="ml-btn-inner">
        {% if button_text %}
          {% include "@atoms/tm-links/standard/standard.twig" with {
            "text": button_text,
            "url": button_url,
            "class": "btn-ml-square " ~ button_class,
            "attributes": button_attributes,
          } only %}
        {% endif %}
        {% if cat_list and cat_list is iterable %}
          {% include "@molecules/html/list/list.twig" with {
            "list": cat_list,
            "item_prefix": '<i class="fas fa-check"></i> ',
            "list_class": 'ulc m-4 ml-cta-list',
          } %}
        {% endif %}
      </div>
    </div>
  </div>
</div>
