{% set com_props = props %}
{%- set section_extra = [
props.order in ["reverse", "default"] ? "--" ~ props.order : "--default",
props.variant in ["product"] ? "--" ~ props.variant : null,
props.extra_class
]|join(' ')|trim -%}
{% set section_props = {
name: "s-text-media",
id: props.id,
is_container: props.is_container,
spacing: props.spacing,
extra_class: section_extra,
bg_color: props.bg_color,
} %}
{% set header_position = props.header_position|default("in") %}
{% set header_in_props = {
heading: {
title: props.header.heading.title,
level: props.header.heading.level|default(2),
style: "h2",
},
spacing: "sm",
variant: "left",
extra_class: "s-text-media__header-in",
} %}
{% set buttons = {} %}
{% if props.buttons.primary %}
{% set buttons = {
primary: {
title: props.buttons.primary.title,
url: props.buttons.primary.url,
icon: {
src: "@Images/svg/chevron-right.svg",
size: "lg"
}
}
} %}
{% else %}
{% set buttons = {
outline: {
title: props.buttons.outline.title,
url: props.buttons.outline.url
}
} %}
{% endif %}
{% set buttons_props = {
buttons: buttons,
align: "left",
spacing: "lg",
} %}
{% embed "@Components/base-section/base-section.twig" with {props: section_props} %}
{% block content %}
{% if com_props.header and header_position == "out" %}
{% include "@Components/base-header/base-header.twig" with {props: com_props.header} %}
{% endif %}
<div class="s-text-media__grid">
{% if com_props.media %}
<div class="s-text-media__col --media-col w-100">
{% include "@Components/items/media-item/media-item.twig" with {props: com_props.media|merge({
variant: com_props.variant
})} %}
</div>
{% else %}
<div class="s-text-media__col --media-col w-100">
{% include "@Components/items/media-item/media-item.twig" with {props: {
variant: com_props.variant,
tag: com_props.tag
}} %}
</div>
{% endif %}
<div class="s-text-media__col --content-col d-flex flex-column justify-content-center w-100">
{% if com_props.header and header_position == "in" %}
{% include "@Components/base-header/base-header.twig" with {props: header_in_props} %}
{% endif %}
{% if com_props.description %}
<div class="s-text-media__description d-flex flex-column gap-6 mb-3">
<div class="s-text-media__meta d-flex flex-column gap-1">
{% if com_props.description.family %}
<div class="s-text-media__family d-flex flex-wrap gap-1 u-color-primary u-fz-sm u-fw-600">
<div class="u-color-primary-500 u-fw-400 s-text-media__meta-label">{{ "Rodina:"|trans }}</div>
{{ com_props.description.family }}
</div>
{% endif %}
{% if com_props.description.category %}
<div class="s-text-media__category d-flex flex-wrap gap-1 u-color-primary u-fz-sm u-fw-600">
<div class="u-color-primary-500 u-fw-400 s-text-media__meta-label">{{ "Kategorie:"|trans }}</div>
{{ com_props.description.category }}
</div>
{% endif %}
{% if com_props.description.code %}
<div class="s-text-media__code d-flex flex-wrap gap-1 u-color-primary u-fz-sm u-fw-600">
<div class="u-color-primary-500 u-fw-400 s-text-media__meta-label">{{ "Kód:"|trans }}</div>
{{ com_props.description.code }}
</div>
{% endif %}
</div>
{% if com_props.description.specs %}
<div class="s-text-media__specs d-flex flex-wrap gap-2 u-posr">
{% for item in com_props.description.specs %}
{% include "@Components/items/tooltip-item/tooltip-item.twig" with {props: item.tooltip|merge({
extra_class: "s-text-media__tooltip"
})} %}
{% endfor %}
</div>
{% endif %}
</div>
{% endif %}
{% if com_props.content %}
<div class="s-text-media__body entry-content u-color-primary-500">
{{ com_props.content|raw }}
</div>
{% endif %}
{% if com_props.buttons %}
{% include "@Components/groups/buttons-group/buttons-group.twig" with {props: buttons_props} %}
{% endif %}
</div>
</div>
{% endblock %}
{% endembed %}