{% if items is defined and items|length > 0 %}
{% for item in items %}
{# Рендерим каждую колонку #}
{% for key, column in columns %}
{{ render_cell(item, key, column)|raw }}
{% endfor %}
{# Колонка действий #}
{% if actionsConfig is defined and actionsConfig|length > 0 %}
{# Фильтруем действия на основе прав доступа #}
{% set visibleActions = [] %}
{% for action in actionsConfig %}
{% set showAction = true %}
{% if action.type is defined %}
{% if action.type == 'edit' and not (can_edit|default(true)) %}
{% set showAction = false %}
{% elseif action.type == 'delete' and not (can_delete|default(true)) %}
{% set showAction = false %}
{% endif %}
{% endif %}
{% if showAction %}
{% set visibleActions = visibleActions|merge([action]) %}
{% endif %}
{% endfor %}
{% if visibleActions|length > 0 %}
{{ render_actions(item, visibleActions)|raw }}
{% else %}
—
{% endif %}