{% macro state_badge(state) %}
  {% if state == "pending" %}
    <span class="badge bg-warning text-dark">{{ state }}</span>
  {% elif state == "running" %}
    <span class="badge bg-primary">{{ state }}</span>
  {% elif state == "succeeded" %}
    <span class="badge bg-success">{{ state }}</span>
  {% elif state == "failed" %}
    <span class="badge bg-danger">{{ state }}</span>
  {% else %}
    <span class="badge bg-secondary">{{ state }}</span>
  {% endif %}
{% endmacro %}