{% if items|length > 0 %}
    <div class="table-responsive page-list">
        <table class="table table-hover point-list" id="pointTable">
            <thead>
            <tr>
                {{ include('@MauticCore/Helper/tableheader.html.twig', {
                    'checkall': 'true',
                    'target': '#pointTable',
                }) }}

                {{ include('@MauticCore/Helper/tableheader.html.twig', {
                        'sessionVar': 'point',
                        'orderBy': 'p.name',
                        'text': 'mautic.core.name',
                        'class': 'col-point-name',
                        'default': true,
                }) }}

                {{ include('@MauticCore/Helper/tableheader.html.twig', {
                        'sessionVar': 'point',
                        'orderBy': 'cat.title',
                        'text': 'mautic.core.category',
                        'class': 'visible-md visible-lg col-point-category',
                }) }}

                {{ include('@MauticCore/Helper/tableheader.html.twig', {
                        'sessionVar': 'point',
                        'orderBy': 'pl.name',
                        'text': 'mautic.point.thead.group',
                        'class': 'visible-md visible-lg col-point-group',
                }) }}

                {{ include('@MauticCore/Helper/tableheader.html.twig', {
                        'sessionVar': 'point',
                        'orderBy': 'p.delta',
                        'text': 'mautic.point.thead.delta',
                        'class': 'visible-md visible-lg col-point-delta',
                }) }}

                <th class="col-point-action">{{ 'mautic.point.thead.action'|trans }}</th>

                {{ include('@MauticCore/Helper/tableheader.html.twig', {
                        'sessionVar': 'point',
                        'orderBy': 'p.id',
                        'text': 'mautic.core.id',
                        'class': 'visible-md visible-lg col-point-id',
                }) }}
            </tr>
            </thead>
            <tbody>
            {% for item in items %}
                <tr>
                    <td>
                        {{ include('@MauticCore/Helper/list_actions.html.twig', {
                                'item': item,
                                'templateButtons': {
                                    'edit': permissions['point:points:edit'],
                                    'clone': permissions['point:points:create'],
                                    'delete': permissions['point:points:delete'],
                                },
                                'routeBase': 'point',
                        }) }}
                    </td>
                    <td>
                        <div>
                            {{ include('@MauticCore/Helper/publishstatus_icon.html.twig', {'item': item, 'model': 'point'}) }}
                            {% if permissions['point:points:edit'] %}
                                <a href="{{ path('mautic_point_action', {'objectAction': 'edit', 'objectId': item.id}) }}" data-toggle="ajax">
                                    {{ item.name }}
                                </a>
                            {% else %}
                                {{ item.name }}
                            {% endif %}
                            {{ customContent('point.name', _context) }}
                        </div>
                        {{ include('@MauticCore/Helper/description--inline.html.twig', {
                            'description': item.description
                        }) }}
                    </td>
                    <td class="visible-md visible-lg">
                        {{ include('@MauticCore/Modules/category--expanded.html.twig', {'category': item.category}) }}
                    </td>
                    <td class="visible-md visible-lg">
                        {% set group = item.group %}
                        {% set groupName = group.name|default('mautic.point.group.form.nogroup'|trans) %}
                        {{ groupName }}
                    </td>
                    <td class="visible-md visible-lg">{{ item.delta }}</td>
                    <td>{{ actions[item.type].label|default('')|trans }}</td>
                    <td class="visible-md visible-lg">{{ item.id }}</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
    <div class="panel-footer">
        {{ include('@MauticCore/Helper/pagination.html.twig', {
                'totalItems': items|length,
                'page': page,
                'limit': limit,
                'menuLinkId': 'mautic_point_index',
                'baseUrl': path('mautic_point_index'),
                'sessionVar': 'point',
        }) }}
    </div>
{% else %}
    {% if searchValue is not empty %}
        {{ include('@MauticCore/Helper/noresults.html.twig', {'tip': 'mautic.point.action.noresults.tip'}) }}
    {% else %}
        <div class="mt-80 col-md-offset-2 col-lg-offset-3 col-md-8 col-lg-5 height-auto">
            {% set childContainer %}
            <div class="mb-md">
                {% include '@MauticCore/Components/pictogram.html.twig' with {
                    'pictogram': 'user--insights',
                    'size': '80'
                } %}
            </div>

            {{ include('@MauticCore/Components/content-item-row.html.twig', {
                type: 'default',
                eyebrow: 'mautic.point.action.empty.understand',
                heading: 'mautic.point.action.empty.what_are_point_actions',
                copy: 'mautic.point.action.empty.what_are_point_actions_desc',
            }) }}

            {{ include('@MauticCore/Components/content-item-row.html.twig', {
                type: 'default',
                eyebrow: 'mautic.point.action.empty.purpose',
                heading: 'mautic.point.action.empty.score_contacts_heading',
                copy: 'mautic.point.action.empty.score_contacts_desc',
            }) }}
            {% endset %}

            {{ include('@MauticCore/Components/content-block.html.twig', {
                heading: 'mautic.point.action.empty.heading',
                subheading: 'mautic.point.action.empty.subheading',
                childContainer: childContainer,
            }) }}
        </div>
    {% endif %}
{% endif %}
