{% macro _dot(color, label) %}
    <span class="Status-dot" style="border-color: {{ color }};" title="{{ label }}"></span>
{% endmacro %}

{% macro _tag(color, label) %}
    {% if label == 'Draft' %}
        {% set type = 'error' %}
    {% endif %}
    <label class="tag tag--{{ type }}">{{ label }}</label>
{% endmacro %}

{% macro _dots(status) %}
<div class="Status-dots">
{% if status.statuses %}
{% for stat in status.statuses %}
{{ _dot(stat.color, stat.label) }}
{% endfor %}
{% else %}
{{ _dot(status.color, status.label) }}
{% endif %}
</div>
{% endmacro %}

{% macro _tags(status) %}
{% if status.statuses %}
{% for stat in status.statuses %}
{{ _tag(stat.color, stat.label) }}
{% endfor %}
{% else %}
{{ _tag(status.color, status.label) }}
{% endif %}
{% endmacro %}

{% macro labelled(status, modifier) %}
{% if status %}
<div class="Status Status--labelled{% if modifier %} Status--{{ modifier }}{% endif %}">
    <label class="Status-label">{{ status.label }}</label>
    {{ _dots(status) }}
</div>
{% endif %}
{% endmacro %}

{% macro unlabelled(status, modifier) %}
{% if status %}
<div class="Status Status--unlabelled{% if modifier %} Status--{{ modifier }}{% endif %}">
{{ _dots(status) }}
</div>
{% endif %}
{% endmacro %}

{% macro tag(status, modifier) %}
{% if status %}

{{ _tag(status.color, status.label) }}

{% endif %}
{% endmacro %}
