{% set sales = __SELF__.sales %}
<!-- Breadcumb Area -->
<div class="breadcumb_area">
    <div class="container h-100">
        <div class="row h-100 align-items-center">
            <div class="col-12">
                <h5>Gelen sargytlar</h5>
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="{{ 'index'|page }}">Esasy sahypa</a></li>
                    <li class="breadcrumb-item active">Gelen sargytlar</li>
                </ol>
            </div>
        </div>
    </div>
</div>
<!-- Breadcumb Area -->

<!-- Wishlist Table Area -->
<div class="wishlist-table section_padding_100 clearfix">
    <div class="container">
        <div class="row">
            <div class="col-12">
                <div class="cart-table wishlist-table">
                    <div class="table-responsive">
                        <table class="table table-bordered mb-30">
                            <thead>
                                <tr>
                                    <th scope="col">Tertip belgisi</th>
                                    <th scope="col">Wagty</th>
                                    <th scope="col">Status</th>
                                    <th scope="col"></th>
                                </tr>
                            </thead>
                            <tbody>

                                {% for sale in sales %}
                                    <tr>
                                        <td><a href="#"> # {{ sale.order_id }} Sargyt</a></td>
                                        <td>{{ sale.created_at.format('d.m.Y') }}</td>
                                        <td>
                                            <span class="badge {{ sale.status == 'new' ? 'badge-secondary' : 'badge-success' }}">{{ sale.status == 'new' ? 'Täze sargyt' : 'Kabul edildi' }}</span> </td>
                                        <td align="center"><a href="{{ 'vendor-sale-detail'|page({id: sale.order_id}) }}" class="btn btn-primary btn-sm">Sargydy görmek</a></td>
                                    </tr>
                                {% endfor %}
                            </tbody>
                        </table>


                        {% if sales.hasPages %}
                            <div class="shop_pagination_area mt-30">
                                <nav aria-label="Page navigation">
                                    <ul class="pagination pagination-sm justify-content-center">
                                        {% if sales.currentPage > 1 %}
                                            <li class="page-item"><a class="page-link" href="{{ sales.previousPageUrl }}">Öňki</a></li>
                                        {% endif %}

                                        {% for page in range(1, sales.lastPage) %}
                                            <li class="page-item"><a class="page-link" href="{{ sales.url(page) }}">{{ page }}</a></li>
                                        {% endfor %}

                                        {% if sales.lastPage > sales.currentPage %}
                                            <li class="page-item"><a class="page-link" href="{{ sales.nextPageUrl }}">Indiki</a></li>
                                        {% endif %}
                                    </ul>
                                </nav>
                            </div>
                        {% endif %}


                    </div>
                </div>
            </div>
        </div>
    </div>
</div>