{# LIBRARIES #}
{{ attach_library('ui_patterns/social_share.social_share_lib') }}

{# VARIABLES #}
{% set style = style|default('links') %}
{% set wrapper_class = [
  wrapper_class,
  'social-' ~ style,
] %}

{# TEMPLATE #}
{% if links %}
  <div class='{{ wrapper_class|join(' ') }}'>
    {% for link in links %}

      {% set link_text %}

        {% if style == 'links' %}
          <i class='fab {{ link.icon_links }}'></i>
          <span class='sr-only'>Follow us on {{ link.title }}</span>
        {% endif %}

        {% if style == 'share' %}
          <i class='fab {{ link.icon_share }}'></i>
          <span>{{ link.share }}</span>
        {% endif %}

      {% endset %}

      {% include "@atoms/tm-links/standard/standard.twig" with {
        "text": link_text,
        "url": link.url,
        "class": link.class,
      } only %}

    {% endfor %}
  </div>
{% endif %}
