{%- set class_name = [
"i-product-variant",
"d-flex flex-column justify-content-center",
"px-1 u-posr w-100",
props.extra_class|default(false) ? props.extra_class : null,
]|join(' ')|trim -%}
{%- set attrs = [
'class="' ~ class_name ~ '"',
] -%}
{% if props.id %}
{%- set attrs = attrs|merge(['id="' ~ props.id ~ '"']) -%}
{% endif %}
{%- set attrs = attrs|join(' ')|trim -%}
{% set open_btn = {
title: "Otevřít variant"|trans,
tag: "button",
type: "button",
size: "sm",
icon_only: true,
icon: {
src: "@Images/svg/chevron-down.svg",
size: "lg"
},
extra_class: "--js-open-variant"
} %}
<div {{ attrs|raw }}>
{% if props.header %}
<ul class="i-product-variant__header d-grid align-items-center gap-1 flex-grow-1 u-cursor-pointer">
{% for item in props.header %}
{% if item %}
<li class="i-product-variant__header-item u-fz-sm u-fw-600 u-color-primary p-1">{{ item|raw|escape }}</li>
{% else %}
<li class="i-product-variant__header-item u-fz-sm u-fw-600 u-color-primary p-1">{{ "-" }}</li>
{% endif %}
{% endfor %}
{% include "@Components/button/button.twig" with {props: open_btn} %}
</ul>
{% endif %}
<div class="i-product-variant__body d-grid u-bg-white">
<div class="i-product-variant__body-inner overflow-hidden">
<div class="i-product-variant__content d-flex flex-column gap-5">
{% include "@Components/items/product-variant-item/product-variant-item--raw.twig" with {props: props} %}
</div>
</div>
</div>
</div>