{% set url = null %}
{% if options.route is defined %}
    {% set url = path(options.route, options.routeOptions|default([])) %}
{% endif %}

<div class="card card-sm">
    <div class="card-body">
        <div class="row align-items-center">
            <div class="col-auto">
                <span class="bg-{{ options.color|default('green') }} text-white avatar">
                    {{ icon(options.icon, true) }}
                </span>
            </div>
            <div class="col">
                <div class="font-weight-medium">
                    <a href="{{ url }}" class="link-dark stretched-link text-reset">
                        {{ title|trans }}
                    </a>
                </div>
                <div class="text-body-secondary">
                    {% if data is iterable %}
                        {{ 'Invalid data' }}
                    {% else %}
                        {% block widget_data %}
                            {{ data }}
                        {% endblock %}
                    {% endif %}
                    <sup style="font-size: 20px">{{ unit|default('') }}</sup>
                </div>
            </div>
        </div>
    </div>
</div>
