{%- set class_name = [
"i-product",
"d-flex flex-column gap-2 p-2 u-posr h-100 u-bg-white",
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 detail_button = {
title: "Detail produktu"|trans,
url: props.url,
onclick: props.onclick,
tag: 'button',
icon: {
src: "@Images/svg/chevron-right.svg",
size: "lg"
},
full_width: true
} %}
{% set img_props = {
is_placeholder: true,
ratio: "1-1",
objectfit: "contain",
width: 296,
height: 296,
alt: props.img.alt|default(props.title|default(""))|escape,
} %}
<article {{ attrs|raw }}>
<figure class="i-product__image d-block u-posr">
<a style="cursor:pointer;" onclick="{{ props.onclick }}" class="i-product__image-link d-flex align-items-center" title="{{ props.title }}">
{% if props.img %}
{% include "@Components/img/img.twig" with {props: props.img|merge(img_props)|merge({
extra_class: "i-product__image"
})} %}
{% else %}
{% include "@Components/img/img.twig" with {props: img_props|merge({
src: base_path ~ "images/content/placeholder.png",
extra_class: "i-product__image-placeholder"
})} %}
{% endif %}
</a>
{% if props.tag %}
{% include "@Components/items/tag-item/tag-item.twig" with {props: {
title: props.tag.title,
size: "sm-base",
variant: "product",
extra_class: "i-product__tag u-posa u-z-index-3"
}} %}
{% endif %}
</figure>
<div class="i-product__wrap d-flex flex-column gap-4">
<div class="i-product__header d-flex flex-column gap-1 px-1">
<h5 class="i-product__title u-fz-lg u-fw-500">
{% include "@Components/link/link.twig" with {props: {
color: "primary-to-conversion",
title: props.title,
onclick: props.onclick,
extra_class: "i-product__link u-clamp",
}} %}
</h5>
{% if props.family %}
<div class="i-product__family d-flex flex-wrap gap-1 u-color-primary-500 u-fz-sm u-fw-600">
<div class="u-color-primary-300 u-fw-400">{{ "Rodina:"|trans }}</div>
{{ props.family }}
</div>
{% endif %}
</div>
<div class="i-product__content d-flex flex-column gap-2 u-posr">
{% if props.code %}
<div class="i-product__code d-flex flex-wrap gap-1 u-color-primary-500 u-fz-sm u-fw-600 px-1">
<div class="u-color-primary-300 u-fw-400 me-3">{{ "Kód:"|trans }}</div>
{{ props.code }}
</div>
{% endif %}
{% if props.specs %}
<div class="i-product__specs d-flex flex-wrap px-1">
{% for item in props.specs %}
{% include "@Components/items/tooltip-item/tooltip-item.twig" with {props: item.tooltip|merge({
extra_class: "i-product__tooltip"
})} %}
{% endfor %}
</div>
{% endif %}
</div>
</div>
<div class="i-product__detail-btn mt-auto w-100">
{% include "@Components/button/button.twig" with {props: detail_button} %}
</div>
</article>