@php
    $saleChannels = $sale_channels ?? [];
@endphp

@if (count($saleChannels) > 1)
    <nav>
        <div class="nav nav-tabs pl-2">
            <a href="#deliveriesTab" data-toggle="tab" class="nav-item nav-link active" role="tab" aria-selected="true">
                MON MODE D'ACHAT
            </a>
            <a href="#ordersTab" data-toggle="tab" class="nav-item nav-link" role="tab" aria-selected="false">
                SUIVI DE COMMANDES
            </a>
            <a href="#invoicesTab" data-toggle="tab" class="nav-item nav-link" role="tab" aria-selected="false">
                FACTURES
            </a>
        </div>
    </nav>

    <div class="tab-content">
        <div class="tab-pane fade show active pt-0 pb-0" id="deliveriesTab">
            <x-card classBody="bg-light">
                @include('Shop.Customers.partials.deliveries')
            </x-card>
        </div>
        <div class="tab-pane fade show pt-0 pb-0" id="ordersTab">
            <x-card classBody="bg-light">
                @include('Shop.Orders.partials.list', [
                    'dataTable' => $orders,
                ])
            </x-card>
        </div>
        <div class="tab-pane fade show pt-0 pb-0" id="invoicesTab">
            <x-card classBody="bg-light">
                @include('Shop.Invoices.partials.list', [
                    'dataTable' => $invoices,
                ])
            </x-card>
        </div>
    </div>
@else
    <nav>
        <div class="nav nav-tabs pl-2">
            <a href="#ordersTab" data-toggle="tab" class="nav-item nav-link active" role="tab" aria-selected="true">
                SUIVI DE COMMANDES
            </a>
            <a href="#invoicesTab" data-toggle="tab" class="nav-item nav-link" role="tab" aria-selected="false">
                FACTURES
            </a>
        </div>
    </nav>

    <div class="tab-content">
        <div class="tab-pane fade show active pt-0 pb-0" id="ordersTab">
            <x-card classBody="bg-light">
                @include('Shop.Orders.partials.list', [
                    'dataTable' => $orders,
                ])
            </x-card>
        </div>
        <div class="tab-pane fade show pt-0 pb-0" id="invoicesTab">
            <x-card classBody="bg-light">
                @include('Shop.Invoices.partials.list', [
                    'dataTable' => $invoices,
                ])
            </x-card>
        </div>
    </div>
@endif
