{#
/**
 * @file
 * Template for Summary component.
 */
#}
{% set id = attributes.id|default('summary') %}
{% set attributes = attributes|default(create_attribute()) %}

<div {{ attributes.addClass('kern-summary') }}>
  {% if number or title %}
  <div class="kern-summary__header">
    {% if number %}
      <span class="kern-number">{{ number }}</span>
    {% endif %}
    {% if title %}
    <h3 class="kern-title kern-title--small" id="{{ id }}_title">
      {{ title }}
    </h3>
    {% endif %}
  </div>
  {% endif %}
  <div class="kern-summary__body">
    {% block summary_body %}
      {% if body_dl %}
        {% embed 'kern_ux_canvas:descriptionlist' with body_dl only %}
        {% endembed %}
      {% elseif summary_body %}
        {{ summary_body }}
      {% endif %}
    {% endblock %}
    <div class="kern-summary__actions">
      {% block summary_actions %}
        {% if edit_link %}
          <a href="{{ edit_link }}" class="kern-link" aria-describedby="{{ id }}_title">
            <span class="kern-icon kern-icon--edit" aria-hidden="true"></span>
            {{ edit_label|default('edit'|t) }}
          </a>
        {% endif %}
        {{ summary_actions }}
      {% endblock %}
    </div>
  </div>
</div>

