<x-app-layout>
    @include('admin.include.sidebar')

        <!-- Page Content  -->
    <div class="wrapper">
        <!-- Sidebar  -->


        <!-- Page Content  -->
        <div id="content" style="padding: 20px 0;">
             <button class="btn btn-danger mb-4" > <a href='{{route("contents.create")}}'>Create Content</a></button>
            <div class="navbar-expand-lg navbar-light bg-light">
                <table id="example" class="table table-striped table-bordered dark" style="width:100%">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Heading</th>
                            <th>Arabic Heading</th>
                            {{-- <th>Description</th> --}}
                            {{-- <th>Arabic Description</th> --}}
                            <!-- <th>status</th> -->
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach ($pages as $item)
                        <tr>
                            <td>{{$item->id}}</td>
                            <td>{{$item->name}}</td>
                            <td>{{$item->name_a}}</td>
                            {{-- <td>{!! $item->description !!}</td> --}}
                            {{-- <td>{!! $item->description_a !!}</td> --}}
                            {{-- <td>
                                <select name="status" class="{{$item->status == 1 ? 'btn btn-success' : 'btn btn-danger'}}" disabled>
                                    <option value="1" {{$item->status == 1 ? 'selected' : ''}}>Active</option>
                                    <option value="0" {{$item->status == 0 ? 'selected' : ''}}>Inctive</option>
                                 </select>
                            </td> --}}
                            <td class="action">
                                    <a class="btn btn-info" href="{{route('contents.edit',$item->id)}}"><i class="fas fa-edit"></i></a>
                                <form action="{{ route('contents.destroy', $item->id) }}" method="POST" style="display: contents;">
                                    @csrf
                                    @method('delete')
                                <button type="submit" class="btn btn-danger" onclick="return condelete()"><i class="fas fa-trash"></i></button>
                                   </form>
                            </td>
                        </tr>
                        @endforeach
                    </tbody>
                </table>
            </div>


        </div>
    </div>

    <script type="text/javascript">
        function condelete()
        {
        var message=confirm("Do you really want to delete");
        if(message==true)
        {
        return true;
        }
        else
        {
        return false;
        }
        }
        bootbox.confirm("Are you sure?", function(result) {
          Example.show("Confirm result: "+result);
        });

      </script>
</x-app-layout>
