{#
SAM Icon Component - Centralized SVG icons
Parameters:
- name: string (required) - Icon name from the dictionary
- size: number (default: 16) - Icon size in pixels
- class: string - Additional CSS classes
- strokeWidth: number (default: 2) - Stroke width
Available icons:
- Entity: users, user, book, cohort, layers
- Action: plus, edit, trash, sync, download, upload, eye, eye-off, link, external-link
- Status: check, check-circle, x, x-circle, alert-triangle, info
- Navigation: chevron-right, chevron-left, chevron-down, chevron-up, arrow-right, arrow-left
- Time/Progress: clock, calendar, activity, trending-up, trending-down
- Chart: chart, pie-chart, bar-chart
- File: folder, file, file-text
- Settings: settings, grid, filter, search
- Other: mail, phone, building, home, smile, frown, percent, award, target, zap
Usage:
{% include 'sam/_components/icon.html.twig' with {name: 'users', size: 20} %}
{% include 'sam/_components/icon.html.twig' with {name: 'book', size: 24, class: 'text-green'} %}
#}
{% set icons = {
'users': '',
'user': '',
'book': '',
'cohort': '',
'layers': '',
'plus': '',
'edit': '',
'trash': '',
'sync': '',
'download': '',
'upload': '',
'eye': '',
'eye-off': '',
'link': '',
'external-link': '',
'check': '',
'check-circle': '',
'x': '',
'x-circle': '',
'alert-triangle': '',
'info': '',
'chevron-right': '',
'chevron-left': '',
'chevron-down': '',
'chevron-up': '',
'arrow-right': '',
'arrow-left': '',
'clock': '',
'calendar': '',
'activity': '',
'trending-up': '',
'trending-down': '',
'chart': '',
'pie-chart': '',
'bar-chart': '',
'folder': '',
'file': '',
'file-text': '',
'settings': '',
'grid': '',
'filter': '',
'search': '',
'mail': '',
'phone': '',
'building': '',
'home': '',
'smile': '',
'frown': '',
'percent': '',
'award': '',
'target': '',
'zap': ''
} %}
{% set iconPath = icons[name|default('file')] ?? icons['file'] %}
{% set iconSize = size|default(16) %}
{% set iconStroke = strokeWidth|default(2) %}