{% 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.showButton %}
                                <a href="{{ consultation.url }}"
                                   class="button"
                                   target="_blank"
                                >
                                    {% if consultation.paymentRequired %}
                                        Pay
                                    {% else %}
                                        Join video
                                    {% endif %}
                                </a>

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

        {% endif %}

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

{% endblock %}
