{% import "tungsten/components/ui.html" as ui %}
{% if a.bulk and a.table_id %}{% set include = '#' ~ a.table_id ~ ' input[name=records]:checked' %}
{% elif a.table_id and a.vals._tw_scope == 'table' %}{% set include = '#' ~ a.table_id ~ ' form' %}
{% else %}{% set include = None %}{% endif %}
{% set label_html %}{{ icon(a.icon, 'h-4 w-4') }}{% if a.style != 'icon' and not a.hidden_label %}{{ a.label }}{% endif %}{% if a.badge %}{{ a.badge }}{% endif %}{% endset %}
{% set cls = ui.button_classes(a.color, a.style, a.size, a.outlined) %}
{% set keys = ('data-tw-keys="' ~ a.keyboard ~ '"') | safe if a.keyboard else '' %}
{% if a.disabled %}
{% elif a.url %}
{{ label_html }}
{% elif a.modal %}
{% else %}
{% endif %}