@extends('web.layouts.layout')
@section('content')

<main>

    @include('web.pages.menu.components.groups')

    <!-- ---------- menu ----------- -->
    <section class="menu_pg pt-5 mt-5">
        <div class="container">
            @if (count($products))
            <form id="form" action="{{route('product.index')}}">
                <input type="hidden" name="group_id" value="{{$request->group_id}}">
                <div class="row align-items-center mb-5">
                    <div class="col-lg-9">
                        <div class="section_title mb-0">
                            <h3 class="title"> {{($group ?? null) ? $group->name : __('web.main_dishes')}} <span class="line wow"></span> </h3>
                        </div>
                    </div>
                    {{--
                    <div class="col-lg-3">
                        <div class="form-group m-0">
                            <select onchange="sort()" name="viewStatus" id="" class="form-control form-select px-3">
                                <option value=""> {{__('web.default_sorting')}} </option>
                                <option {{$request->viewStatus == 'popular' ? 'selected' : ''}} value="popular"> {{__('web.sort_population')}} </option>
                                <option {{$request->viewStatus == 'latest' ? 'selected' : ''}} value="latest"> {{__('web.sort_latest')}} </option>
                                <option {{$request->viewStatus == 'priceASC' ? 'selected' : ''}} value="priceASC"> {{__('web.sort_price_low_high')}} </option>
                                <option {{$request->viewStatus == 'priceDESC' ? 'selected' : ''}} value="priceDESC"> {{__('web.sort_price_high_low')}} </option>
                            </select>
                        </div>
                    </div>
                    --}}
                </div>
                <div class="cards">
                    <div class="row">
                        @foreach($products as $row)
                            @include('web.pages.components.menu.product',['product'=>$row])
                        @endforeach
                    </div>
                </div>
            </form>
            @endif
        </div>
    </section>
    
    <!-- ---------- instagram ----------- -->
        @include('web.pages.components.instagram') 
    <!-- <div class="img_pattern1">
    </div> -->
</main>

@stop

@section('inject_js')
    <script>
        function sort()
        {
            $('#form').submit()
        }
    </script>
@endsection
