<div class="main">

<div class="sdoc-table_key_value">

{% for metric_or_section_ in view_object.metrics %}
  {% if metric_or_section_.__class__.__name__ == "MetricSection" %}
    {% with key_value_pair =
      {
      "Section": metric_or_section_.name
      }
    %}
      {% include "components/table_key_value/index.jinja" %}
    {% endwith %}

    {% for metric_ in metric_or_section_.metrics %}
      {% with key_value_pair =
        {
          "Key": metric_.name,
          "Value": metric_.value,
          "Link": view_object.render_url(metric_.link) if metric_.link is not none else none,
        }
      %}
        {% include "components/table_key_value/index.jinja" %}
      {% endwith %}
    {% endfor %}
  {% else %}
    {% with key_value_pair =
      {
        "Key": metric_or_section_.name,
        "Value": metric_or_section_.value,
      }
    %}
      {% include "components/table_key_value/index.jinja" %}
    {% endwith %}
  {% endif %}
{% endfor %}

</div>{# / .sdoc-table_key_value #}

</div>{# / .main #}
