{% import "@component/_template/_html_macro.html.twig" as macros %}
{% if componentKey is not defined %}
{% set componentKey = '' %}
{% endif %}
{% if isEmpty is not defined %}
{% set isEmpty = false %}
{% endif %}
{% if item_config is not defined %}
{% set item_config = generateComponentOptions(value, componentKey) %}
{% endif %}
{% if customItemClass is not defined %}
{% set customItemClass = '' %}
{% endif %}
{% if customDisplayOverride is not defined %}
{% set customDisplayOverride = true %}
{% endif %}
{% if item_config is not empty
and canDisplayComponentByAcl(item_config)
and customDisplayOverride is same as(true)
%}
{% if isEmpty is same as(false) %}
{#WRAPPER#}
{{ macros.generateHtmlComponentStart(item_config.wrapper) }}
{#ITEM#}
{{ macros.generateHtmlComponentStart(item_config.item, customItemClass) }}
{#CONTAINER#}
{{ macros.generateHtmlComponentStart(item_config.container) }}
{% block component %}{% endblock component %}
{{ macros.generateHtmlComponentEnd(item_config.container) }}{#/CONTAINER#}
{{ macros.generateHtmlComponentEnd(item_config.item) }}{#/ITEM#}
{{ macros.generateHtmlComponentEnd(item_config.wrapper) }}{#/WRAPPER#}
{% else %}
{#WRAPPER#}
{{ macros.generateHtmlComponentStart(item_config.wrapper) }}
{% block displayIfEmpty %}{% endblock %}
{{ macros.generateHtmlComponentEnd(item_config.wrapper) }}{#/WRAPPER#}
{% endif %}
{% endif %}