<div class="table-responsive">
  <table class="table table-bordered align-middle" style="width:100%">
      <thead class="table-light">
          <tr>
              <th>Sl No</th>
              <th>Bucket Name</th>
              <th>Root Folder</th>
              <th>Access Key </th>
              <th>Company Name</th>
              <th class="thbutton">Status</th>
              <th class="thbutton">Edit</th>
              <th class="thbutton">Delete</th>
          </tr>
      </thead>
      <tbody>
        @php $i=1;@endphp
        @if(count($bucketData)>0)
        @foreach($bucketData as $key => $list)
        <tr>
            <td>{{$bucketData->firstItem() + $key}}</td>
            <td>{{$list->bucket_name}}</td>
            <td>{{$list->root_folder}}</td>
            <td>{{$list->access_key}}</td>
            <td style="white-space:pre-wrap; word-wrap:break-word">@if(isset($list->getCompanyName->name)){{$list->getCompanyName->name}}@endif</td>
            <td align="center">
                <div class="form-check form-check-inline{{$i}}">
                    <input class="form-check-input{{$i}} btn-lg changeStatus" type="checkbox" id="inlineCheckbox{{$i}}" data-url="{{route('buckets.changestatus')}}" data-id="{{$list->id}}" data-status="@if($list->status=='0'){{'1'}}@elseif($list->status=='1'){{'0'}}@endif" @if($list->status=='1'){{'checked'}}@elseif($list->status=='0'){{''}}@endif>
                </div>
            </td>
            <td>
                <a href="{{ route('buckets.edit',$list->id)}}" class="btn btn-warning" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Edit">
                    <i class="bi bi-pencil-square text-white"></i>
                </a>
            </td>
            
            
            <td>
                <a href="#"  data-url="{{route('buckets.destroy')}}" data-id="{{$list->id}}" class="btn btn-danger deleteData" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Delete">
                    <i class="bi bi-trash text-white"></i>
                </a>
            </td>
            
        </tr>
        @php $i++; @endphp
        @endforeach
        @else
        <tr>
            <td colspan="8">No Data Found</td>
        </tr>
        @endif
    </tbody>
</table>
</div>
<nav class="float-start mt-2">
    <ul class="pagination">
        {!! $bucketData->onEachSide(1)->render('bucket.pagination') !!}
    </ul>
</nav>
</div>

