{% extends 'layouts/members.twig' %}

{% block members_content %}

    <div class="membersContentWrap">

        {% include 'includes/elements/intro_block.twig' with {
            intro_title: 'Consultations',
            intro_content: false,
            class: 'membersIntro',
            use_h1: true
        }%}


        {% if consultations | length < 1 %}
            <div class="buttonWrapper">
                <a href="{{ route('wisebee-book', [], false) }}"
                   class="button"
                >
                    Book a consultation
                </a>
            </div> <!-- .buttonWrapper -->
            <p>You have no consultations</p>
        {% else %}

            <table>
                <tr>
                    <th>Date</th>
                    <th>Time</th>
                    <th>Prescriber</th>
                    <th>Status</th>
                    <th></th>
                </tr>
                {% for consultation in consultations %}
                    <tr>
                        <td>{{ consultation.date }}</td>
                        <td>{{ consultation.time }}</td>
                        <td>{{ consultation.user }}</td>
                        <td>{{ consultation.status }}</td>
                        <td>
                            {% if consultation.actions is not empty %}
                                {% for action in consultation.actions %}
                                    <div class="consultationButtons">
                                        <a href="{{ action.url }}"
                                           target="_blank"
                                        >
                                            {{ action.name }}
                                        </a>
                                    </div>

                                {% endfor %}
                            {% endif %}
                        </td>
                    </tr>
                {% endfor %}
            </table>

        {% endif %}

    </div> <!-- .membersContentGrid -->

{% endblock %}
