{% import '@SyliusUi/Macro/messages.html.twig' as messages %}
{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %}
{% import '@SyliusUi/Macro/labels.html.twig' as labels %}

<h3 class="ui top attached header">{{ 'sylius.ui.new_customers'|trans }}</h3>
<div class="ui attached segment">
    {% if customers|length > 0 %}
        <table class="ui stackable very basic table" id="customers">
            <thead>
                <th style="color: #ababab;">{{ 'sylius.ui.name'|trans }}</th>
                <th></th>
                <th></th>
            </thead>
            <tbody>
            {% for customer in customers %}
                <tr>
                    <td>
                        <strong>{{ customer.fullName }}</strong><br>
                        <div style="color: #ababab;">{{ customer.email }}</div>
                    </td>
                    <td>
                        {% if customer.user is null %}
                            <span class="ui icon label">
                                <i class="spy icon"></i> {{ 'sylius.ui.guest'|trans }}
                            </span>
                        {% endif %}
                    </td>
                    <td>
                        <div class="ui right floated buttons">
                            {{ buttons.show(path('sylius_admin_customer_show', {'id': customer.id})) }}
                        </div>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    {% else %}
        {{ messages.info('sylius.ui.no_results_to_display') }}
    {% endif %}
</div>
