@extends('layout.index', [
    'title' => __('shop.deliveries.title'),
    'subtitle' => __('shop.deliveries.list'),
    'breadcrumb' => [__('shop.deliveries.title')],
])

@section('content')
    <x-card>
        @include('components.datatable', [
            'route' => route('Admin.Shop.Deliveries.index'),
            'model' => 'deliveries',
            'with_filters' => true,
            'callback' => 'handleDelivery();',
        ])
        @component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-deliveries-filters'])
            @include('Admin.Shop.Deliveries.partials.filters', ['model' => 'deliveries'])
        @endcomponent
    </x-card>
@endsection

@include('load.form.select2')
@include('load.form.toggle')

@push('js')
    <script>
        function handleDelivery() {
            initToggle("{{ route('Admin.Shop.Deliveries.toggleActive') }}");
        }

        $(document).ready(function() {
            initSelect2();
        });
    </script>
@endpush
