2026-08-03 21:11:54 +00:00
|
|
|
|
@props([
|
|
|
|
|
|
'from' => 0,
|
|
|
|
|
|
'to' => 0,
|
|
|
|
|
|
'total' => 0,
|
|
|
|
|
|
'currentPage' => 1,
|
|
|
|
|
|
'lastPage' => 1,
|
|
|
|
|
|
/** Comma-separated Livewire actions that should show the loading state */
|
|
|
|
|
|
'wireTarget' => null,
|
|
|
|
|
|
'firstAction' => null,
|
|
|
|
|
|
'previousAction' => null,
|
|
|
|
|
|
'nextAction' => null,
|
|
|
|
|
|
'lastAction' => null,
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
@php
|
|
|
|
|
|
$onFirstPage = (int) $currentPage <= 1;
|
|
|
|
|
|
$onLastPage = (int) $currentPage >= (int) $lastPage;
|
2026-08-15 22:58:23 +00:00
|
|
|
|
$buttonClass =
|
|
|
|
|
|
'flex size-7 items-center justify-center rounded-md border border-neutral-200 text-neutral-500 transition-colors hover:bg-neutral-100 hover:text-black disabled:pointer-events-none disabled:opacity-35 dark:border-white/[0.08] dark:text-fg-dim dark:hover:bg-white/[0.06] dark:hover:text-fg';
|
2026-08-03 21:11:54 +00:00
|
|
|
|
$hasLoading = filled($wireTarget);
|
|
|
|
|
|
@endphp
|
|
|
|
|
|
|
2026-08-15 22:58:23 +00:00
|
|
|
|
<footer {{ $attributes->class('flex min-h-11 items-center justify-between border-t border-neutral-200 px-4 text-[11px] text-neutral-500 dark:border-white/[0.08] dark:text-fg-faint') }}>
|
|
|
|
|
|
<div class="flex items-center gap-3">
|
|
|
|
|
|
<span class="inline-flex h-7 items-center whitespace-nowrap tabular-nums">{{ $from }}–{{ $to }} of {{ $total }}</span>
|
|
|
|
|
|
@isset($pageSize)
|
|
|
|
|
|
{{ $pageSize }}
|
|
|
|
|
|
@endisset
|
|
|
|
|
|
@if ($hasLoading)
|
|
|
|
|
|
<span wire:loading.inline-flex wire:target="{{ $wireTarget }}" class="inline-flex items-center"
|
|
|
|
|
|
aria-live="polite">
|
|
|
|
|
|
<svg class="loading-indicator size-3.5 animate-spin" xmlns="http://www.w3.org/2000/svg" fill="none"
|
|
|
|
|
|
viewBox="0 0 24 24" aria-hidden="true">
|
|
|
|
|
|
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
|
|
|
|
|
<path class="opacity-75" fill="currentColor"
|
|
|
|
|
|
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">
|
|
|
|
|
|
</path>
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
<span class="sr-only">Loading page…</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
@endif
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="flex items-center gap-1">
|
|
|
|
|
|
<button type="button" class="{{ $buttonClass }}" aria-label="Previous page"
|
2026-08-03 21:11:54 +00:00
|
|
|
|
@if (filled($previousAction)) wire:click="{{ $previousAction }}" @endif
|
|
|
|
|
|
@if ($hasLoading) wire:loading.attr="disabled" wire:target="{{ $wireTarget }}" @endif
|
|
|
|
|
|
@disabled($onFirstPage)>
|
2026-08-15 22:58:23 +00:00
|
|
|
|
<x-reicon name="arrow-right" class="size-3.5 rotate-180" />
|
2026-08-03 21:11:54 +00:00
|
|
|
|
</button>
|
2026-08-15 22:58:23 +00:00
|
|
|
|
<button type="button" class="{{ $buttonClass }}" aria-label="Next page"
|
2026-08-03 21:11:54 +00:00
|
|
|
|
@if (filled($nextAction)) wire:click="{{ $nextAction }}" @endif
|
|
|
|
|
|
@if ($hasLoading) wire:loading.attr="disabled" wire:target="{{ $wireTarget }}" @endif
|
|
|
|
|
|
@disabled($onLastPage)>
|
2026-08-15 22:58:23 +00:00
|
|
|
|
<x-reicon name="arrow-right" class="size-3.5" />
|
2026-08-03 21:11:54 +00:00
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
2026-08-15 22:58:23 +00:00
|
|
|
|
</footer>
|