{#
/**
 * @file
 * Theme override for a set of links.
 *
 * This version uses gcds-button SDC.
 */
#}
{% if links -%}
  {%- if heading -%}
    {%- if heading.level -%}
      <{{ heading.level }}{{ heading.attributes }}>{{ heading.text }}</{{ heading.level }}>
    {%- else -%}
      <h2{{ heading.attributes }}>{{ heading.text }}</h2>
    {%- endif -%}
  {%- endif -%}
  <ul{{ attributes }}>
    {%- for item in links -%}
      <li{{ item.attributes }}>
        {%- if item.link -%}
          {%- if use_gcds -%}
            {{ include('gcds:gcds-button', {
              'type': 'link',
              'button_role': (item.link['#url'].routeName == 'entity.comment.delete_form') ? 'danger' : 'primary',
              'href': item.link['#url'].toString(),
              'size': gcds_size ?: null,
              'default': item.text,
            }, with_context = false) }}
          {%- else -%}
            {{ item.link }}
          {%- endif -%}
        {%- elseif item.text_attributes -%}
          <span{{ item.text_attributes }}>{{ item.text }}</span>
        {%- else -%}
          {{ item.text }}
        {%- endif -%}
      </li>
    {%- endfor -%}
  </ul>
{%- endif %}
