<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>Title</th>
		        {{-- <th>Text</th> --}}
		        <th>Priority</th>
		        <th class="thbutton">Default</th>
		        <th class="thbutton">Status</th>
		        @if(auth()->user()->can('test-item-template-edit'))
		        	<th class="thbutton">Edit</th>
		        @endif
		        @if(auth()->user()->can('test-item-template-delete'))
		        	<th class="thbutton">Delete</th>
		        @endif
		    </tr>
	    </thead>
	    <tbody>
	    	@php $i=1;@endphp
            @if(isset($data) && count($data)>0)
		    	@foreach ($data as $key => $range)
				    <tr>
				        <td>{{$data->firstItem() + $key}}</td>
                        <td>{{$range->template_title}}</td>
                        {{-- <td>{!! substr($range->template_text, 0, 40) !!}</td> --}}
                        <td>{{$range->priority}}</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-templates.changeDefault') }}" data-id="{{ $range->id }}" data-status="{{ $range->default == '0' ? '1' : '0' }}" {{ $range->default == '1' ? 'checked' : '' }}>
                            </div>
                        </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-templates.changestatus')}}" data-id="{{$range->id}}" data-status="{{$range->status=='0' ? '1' : '0'}}" {{ $range->status=='1' ? 'checked' : ''}}>
                            </div>
                        </td>
                        @if(auth()->user()->can('test-item-template-edit'))
                        <td>
                            <a href="{{route('test-item-templates.edit',$range->id)}}" class="btn btn-outline-secondary" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Edit">
                                <i class="bi bi-pencil-square"></i>
                            </a>
                        </td>
                        @endif
                        @if(auth()->user()->can('test-item-template-delete'))
                        <td>
                            <a data-url="{{route('test-item-templates.destroy')}}" data-id="{{$range->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="12">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-normal-range-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-normal-ranges.import-create', $item_id) !!}"><i class="bi bi-upload"></i> Upload from Excel</a> --}}
        </div>
      </div>
    @endif
</nav>
</div>
