{#
/**
 * @file
 * Template for Badge component.
 */
#}
{% set variant = variant|default('info') %}
{% set attributes = attributes|default(create_attribute()) %}

{% set classes = [
  'kern-badge',
  'kern-badge--' ~ variant,
] %}

<span {{ attributes.addClass(classes) }}>
  {% if show_icon and icon %}
    {{ icon }}
  {% elseif show_icon %}
    {% embed 'kern_ux_canvas:icon' with {icon: variant} %}{% endembed %}
  {% endif %}
  <span class="kern-label kern-label--small">{{ label }}</span>
</span>
