@include('components.datatable', [
    'route' => route('Shop.Orders.index'),
    'model' => 'orders',
    'with_add' => false,
    'with_filters' => true,
    'with_exports' => false,
    'with_print' => false,
    'show_callback' => 'OrderView(id);',
])

@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-orders-filters'])
    @include('Shop.Orders.partials.filters', ['model' => 'orders'])
@endcomponent

@push('js')
    <script>
        function OrderView(id) {
            var url_open = "{{ route('Shop.Orders.view') }}/" + id;
            openModal("Voir une commande", '#order-form', url_open, false, false, 'xl', {{ !($with_add ?? false) }});
        }

        function OrderRefresh() {
            reloadDatatable("orders");
        }
    </script>
@endpush
