{% extends "default.njk" %}
{% block body %}

    <div class="container is-desktop page">
        <table class="table is-striped is-fullwidth is-hoverable">
            <thead>
                <tr>
                    <h4 class="title is-4 has-text-centered">Kasutajad</h4>
                </tr>
                <tr>
                    <th>Nimi</th>
                    <th>e-post</th>
                    <th>Admin</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                {% asyncEach user in users %}
                <tr class="userRow" id="{{ user.id }}">
                    <td>
                        {{ user.firstName }}
                        {{ user.lastName }}
                    </td>
                    <td>
                        {{ user.email }}
                    </td>
                    <td>
                        {% if user.isAdmin %}
                            <span class="icon">
                                <i class="fas fa-check"></i>
                            </span>
                        {% endif %}
                    </td>
                    <td>
                        <a href="#">
                            <span class="icon">
                                <i class="fas fa-edit"></i>
                            </span>
                        </a>
                    </td>
                </tr>
                {% endeach %}
            </tbody>
        </table>
    </div>

{% endblock %}