{%- set class_name = [
"icon",
"d-flex align-items-center justify-content-center",
props.color in ["primary", "white", "black", "danger"] ? "--colored --" ~ props.color : null,
props.size in ["xs", "sm", "md", "lg", "xl", "xxl", "xxxl", "4xl"] ? "--" ~ props.size : null,
props.stroke_off ? "--stroke-off" : null,
props.extra_class|default(false) ? props.extra_class : null,
props.name|default(false) ? props.name : null,
]|join(' ')|trim -%}
{%- set attrs = [
'class="' ~ class_name ~ '"',
] -%}
{%- set attrs = attrs|join(' ')|trim -%}
{%- set tag = props.tag in ['div', 'span'] ? props.tag : "span" -%}
{% if props.src %}
{% set is_svg = props.src|split('.')|last == "svg" %}
{% set is_from_sulu = 'uploads/media' in props.src %}
<{{tag}} {{ attrs|raw }}>
{% if is_svg and not is_from_sulu %}
{% include props.src %}
{% else %}
{% include "@Components/img/img.twig" with {props: {
src: props.src,
disable_lazy: true,
}} %}
{% endif %}
</{{tag}}>
{% endif %}