<div class="table-responsive">
	<table id="example" class="table table-bordered align-middle" style="width:100%">
	    <thead class="table-light">
		    <tr>
		        <th class="thbutton">Sl No</th>
		        <th>Name</th>
		        <th>Style Type</th>
		        <th class="thbutton">Status</th>
                @if(in_array('test-item-option-edit', $authRolePermissions))
		        	<th class="thbutton">Edit</th>
		        @endif
                @if(in_array('test-item-option-delete', $authRolePermissions))
		        	<th class="thbutton">Delete</th>
		        @endif
		    </tr>
	    </thead>
	    <tbody> 
	    	@php $i=1;@endphp
            @if(count($data)>0)
		    	@foreach ($data as $key => $option)
				    <tr>
				        <td>{{$data->firstItem() + $key}}</td>
				        <td>{{ $option->name }}</td>
				        <td>{{ $option->style }}</td>
				        <td>
                            <div class="form-check form-check-inline{{$i}}">
                                <input class="form-check-input{{$i}} btn-lg changeStatusCustom" type="checkbox" id="inlineCheckbox{{$i}}" data-url="{{route('test-item-options.changestatus')}}" data-id="{{$option->id}}" data-status="{{$option->status=='0' ? '1' : '0'}}" {{ $option->status=='1' ? 'checked' : ''}}>
                            </div>
                        </td>
                        @if(in_array('test-item-option-edit', $authRolePermissions))
                        <td>
                            <button data-id="{{ $option->id }}" class="btn btn-outline-secondary edit" data-bs-toggle="modal" data-bs-target="#commonModal" title="Edit">
                                <i class="bi bi-pencil-square"></i>
                            </button>
                        </td>
                        @endif
                        @if(in_array('test-item-option-delete', $authRolePermissions))
                        <td>
                            <a data-url="{{route('test-item-options.destroy')}}" data-id="{{$option->id}}" class="btn btn-danger deleteDataCustom" class="text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Delete">
                                <i class="bi bi-trash text-white"></i>
                            </a>
                        </td>
                        @endif
				    </tr>
			    @endforeach
			@else
                <tr>
                    <td colspan="6">No Data Found</td>
                </tr>
            @endif
	    </tbody>
	</table>
</div>
<nav class="row align-items-center mt-3">
    <div class="col-md-6">
        {!! $data->onEachSide(0)->render('test-item-options.pagination') !!}
    </div>
	 @if(auth()->user()->can('test-item-option-import'))
      <div class="col-md-6" style="text-align: right;">
        <div class="btn-group mb-0">
            <a class="btn btn-outline-primary" href="{!! route('test-item-options.import-create', $item_id) !!}"><i class="bi bi-upload"></i> Upload from Excel</a>
        </div>
      </div>
    @endif
</nav>
</div>