<div class="table-responsive">
    <div class="d-flex justify-content-between">
        <h5 class="mb-0">Image And Files</h5>
        <button type="button" class="btn btn-primary" id="createImages"  data-bs-toggle="modal" data-bs-target="#commonModal"><i class="bx bx-plus"></i> Add New</button>
    </div>
    <hr class="mb-2">
    <table id="example" class="table table-bordered align-middle" style="width:100%">
        <thead class="table-light">
            <tr>
                <th class="thbutton">Sl No</th>
                <th>Image/Files</th>
                <th>File Type</th>
                <th class="tex-right">Priority</th>
                <th class="thbutton">Is Default</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($images)>0)
                @foreach($images as $key=> $list)
                    <tr>
                        <td class="text-center">{{ 1 + $key}}</td>
                       <td class="text-left">
                        @if($list->file_type == 'pdf')
                                <a href="{!! route('bucket_file_download', ['filename' => getTempUrl($list->image_url)]) !!}" class="btn btn-success">
                                   <i class="bi bi-file-earmark-text"></i> View File 
                                </a>
                        @else
                        <img src="{{getTempUrl($list->image_url)}}" width="75px" height="75px">
                        @endif
                    </td>
                        <td>{!! strtoupper($list->file_type)  !!}</td>
                        <td>{!! $list->priority !!}</td>
                        <td>
                            <div class="col-md-3 form-check form-check-inline-raw">
                                <input class="form-check-input-raw btn-lg changeStatusCustom" type="checkbox" id="inlineCheckbox-raw" data-url="{{route('product-image.changeIsDefault')}}" data-id="{{$list->id}}" data-status="{{$list->is_default=='0' ? 1 : 0}}" {{ $list->is_default=='1' ? 'checked' : ''}}>
                            </div>
                        </td>
                        <td class="text-center">
                            <div class="col-md-3 form-check form-check-inline-raw">
                                <input class="form-check-input-raw btn-lg changeStatusCustom" type="checkbox" id="inlineCheckbox-raw" data-url="{{route('product-image.changeStatus')}}" data-id="{{$list->id}}" data-status="{{$list->status=='0' ? '1' : '0'}}" {{ $list->status=='1' ? 'checked' : ''}}>
                            </div>
                        </td>
                        <td class="text-center">
                            <button data-id="{{ $list->id }}" class="btn btn-warning image_edit" data-bs-toggle="modal" data-bs-target="#commonModal" title="Edit">
                                <i class="bi bi-pencil-square text-white"></i>
                            </button>
                        </td>
                        <td class="text-center">
                            <a data-url="{{route('product-image.destroy')}}" data-id="{{$list->id}}" class="btn btn-danger deleteAccountData" class="text-danger" 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="12">No Data Found</td>
            </tr>
            @endif
        </tbody>
    </table>
</div>
</div>

