{# SAM Badge Component - Unified badge/pill with entity colors Parameters: - text: string (required) - Badge text - type: string - Badge type: 'users', 'cohorts', 'courses', 'activities', 'success', 'warning', 'danger', 'info', 'neutral' - size: string - Size: 'sm', 'md', 'lg' - default: md - icon: string - Icon name (from icon.html.twig) - count: number - Optional count to display - dot: bool - Show status dot instead of icon Usage: {% include 'sam/_components/badge.html.twig' with {text: '12 users', type: 'users'} %} {% include 'sam/_components/badge.html.twig' with {text: 'Active', type: 'success', dot: true} %} {% include 'sam/_components/badge.html.twig' with {text: 'Formation', type: 'cohorts', icon: 'layers'} %} #} {% set badgeType = type|default('neutral') %} {% set badgeSize = size|default('md') %} {% set badgeClasses = ['sam-badge', 'sam-badge--' ~ badgeType, 'sam-badge--' ~ badgeSize] %} {% if dot|default(false) %} {% elseif icon is defined and icon %} {% include 'sam/_components/icon.html.twig' with {name: icon, size: badgeSize == 'sm' ? 10 : (badgeSize == 'lg' ? 14 : 12)} %} {% endif %} {{ text }} {% if count is defined %} {{ count }} {% endif %}