{% 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>{{ 'profileDropdown.GelenSargytlar'|_ }}</h5>
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="{{ 'index'|page }}">{{ 'breadcrumbEsasySahypa'|_ }}</a></li>
                    <li class="breadcrumb-item active">{{ 'profileDropdown.GelenSargytlar'|_ }}</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">
            {% partial "user/menu" %}
        
            <div class="col-12 col-lg-9">
                <div class="cart-table wishlist-table">
                    <div class="table-responsive">
                        <table class="table table-bordered mb-30">
                            <thead>
                                <tr>
                                    <th scope="col">{{ 'zakaz.TertipBelgisi'|_ }}</th>
                                    <th scope="col">{{ 'zakaz.Wagty'|_ }}</th>
                                    <th scope="col">{{ 'zakaz.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">{{ 'order.SargydyGormek'|_ }}</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 }}">{{ 'paginationOnki'|_ }}</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 }}">{{ 'paginationIndiki'|_ }}</a></li>
                                        {% endif %}
                                    </ul>
                                </nav>
                            </div>
                        {% endif %}


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