{% set input_types = ["radio"] %}
{%- set class_name = [
"i-category",
"d-flex align-items-center",
"u-cursor-pointer u-posr h-100",
props.active ? "--active" : null,
props.disabled ? "--disabled" : null,
props.as in input_types ? "--input --" ~ props.as ~ " u-posr" : null,
]|join(' ')|trim -%}
{%- set attrs = [
'class="' ~ class_name ~ '"',
] -%}
{%- if props.url is defined %}
{%- set attrs = attrs|merge(['href="' ~ props.url ~ '"']) -%}
{%- set attrs = attrs|merge(['title="' ~ props.title ~ '"']) -%}
{%- endif -%}
{%- if props.onclick is defined %}
{%- set attrs = attrs|merge(['onclick="' ~ props.onclick ~ '"']) -%}
{%- endif -%}
{% set tag = props.url ? "a" : "label" %}
{% if props.as in input_types %}
{% if props.id %}
{%- set attrs = attrs|merge(['for="' ~ props.id ~ '"']) -%}
{% endif %}
{% endif %}
{%- set attrs = attrs|join(' ')|trim -%}
{% set img_props = {
is_placeholder: true,
width: 56,
height: 56,
ratio: "1-1",
} %}
<{{tag}} {{ attrs|raw }}>
{% if props.is_family %}
<div class="i-category__image flex-shrink-0">
{% if props.img %}
{% include "@Components/img/img.twig" with {props: props.img|merge(img_props)} %}
{% else %}
{% include "@Components/img/img.twig" with {props: {
src: base_path ~ "images/content/placeholder.png",
}|merge(img_props)} %}
{% endif %}
</div>
{% endif %}
{% if props.title %}
<div class="i-category__title u-fw-600 u-fz-sm py-1 px-2">{{ props.title }}</div>
{% endif %}
{% if props.as in input_types %}
<input type="{{ props.as }}" name="{{ props.name }}" id="{{ props.id }}" value="{{ props.value }}" data-filter-title="{{ props.title }}" {{ props.checked ? "checked" : null }} {{ props.disabled ? "disabled" : null }} class="i-category__input u-posa u-left-0 u-bottom-0">
{% endif %}
</{{tag}}>