<div>
    <div class="card-header">
        <div class="d-flex justify-content-between align-items-center">
            <strong>Pop-uplar</strong>

            <div class="d-flex align-items-center gap-2">
                <div class="input-group position-relative">
                    <select class="form-select" wire:model.live="paginate" id="paginate">
                        <option value="10">10</option>
                        <option value="25">25</option>
                        <option value="50">50</option>
                        <option value="100">100</option>
                        <option value="250">250</option>
                        <option value="500">500</option>
                    </select>
                </div>
            </div>

        </div>
    </div>

    <div class="card-body">
        <div class="example">
            <div class="tab-content rounded-bottom">
                <div class="tab-pane active preview" role="tabpanel" id="preview-1005">
                    <table class="table table-hover">
                        <thead>
                            <tr>
                                <th scope="col">Başlık</th>
                                @canany(['popup.update', 'popup.delete'])
                                    <th scope="col">İşlem</th>
                                @endcanany
                            </tr>
                        </thead>
                        <tbody wire:sortable="updateOrder">
                            @foreach ($this->popups as $popup)
                                <tr wire:sortable.item="{{ $popup->id }}" wire:key="item-{{ $popup->id }}">
                                    <td wire:sortable.handle style="cursor:move;">
                                        {{ $popup->title }}
                                    </td>
                                    @canany(['popup.update', 'popup.delete'])
                                        <td>
                                            @can('popup.update')
                                                <a href="{{ route('admin.popup.edit', $popup->id) }}" class="btn btn-sm btn-outline-primary">
                                                    <span class="cil-pencil"></span>
                                                </a>
                                            @endcan

                                            @can('popup.delete')
                                                <button type="button" wire:click="deleteConfirm({{ $popup->id }})" wire:loading.attr="disabled" class="btn btn-sm btn-outline-secondary text-secondary">
                                                    <span class="cil-trash"></span>
                                                </button>
                                            @endcan
                                        </td>
                                    @endcanany
                                </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="px-4">
        {{ $this->popups->links() }}
    </div>
</div>
