openclassify/resources/views/vendor/pagination/tailwind.blade.php
2026-03-07 20:19:00 +03:00

98 lines
6.1 KiB
PHP

@if ($paginator->hasPages())
<nav role="navigation" aria-label="{{ __('Pagination Navigation') }}">
<div class="flex items-center justify-between gap-2 sm:hidden">
@if ($paginator->onFirstPage())
<span class="inline-flex items-center rounded-full border border-slate-200 bg-white px-4 py-2 text-sm font-medium text-slate-400 cursor-not-allowed">
{!! __('pagination.previous') !!}
</span>
@else
<a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="inline-flex items-center rounded-full border border-slate-200 bg-white px-4 py-2 text-sm font-medium text-slate-700 transition hover:bg-slate-50">
{!! __('pagination.previous') !!}
</a>
@endif
@if ($paginator->hasMorePages())
<a href="{{ $paginator->nextPageUrl() }}" rel="next" class="inline-flex items-center rounded-full border border-slate-200 bg-white px-4 py-2 text-sm font-medium text-slate-700 transition hover:bg-slate-50">
{!! __('pagination.next') !!}
</a>
@else
<span class="inline-flex items-center rounded-full border border-slate-200 bg-white px-4 py-2 text-sm font-medium text-slate-400 cursor-not-allowed">
{!! __('pagination.next') !!}
</span>
@endif
</div>
<div class="hidden sm:flex sm:items-center sm:justify-between sm:gap-4">
<div>
<p class="text-sm text-slate-600">
{!! __('Showing') !!}
@if ($paginator->firstItem())
<span class="font-semibold text-slate-900">{{ $paginator->firstItem() }}</span>
{!! __('to') !!}
<span class="font-semibold text-slate-900">{{ $paginator->lastItem() }}</span>
@else
{{ $paginator->count() }}
@endif
{!! __('of') !!}
<span class="font-semibold text-slate-900">{{ $paginator->total() }}</span>
{!! __('results') !!}
</p>
</div>
<div>
<span class="inline-flex rounded-full bg-white shadow-sm ring-1 ring-slate-200 overflow-hidden">
@if ($paginator->onFirstPage())
<span aria-disabled="true" aria-label="{{ __('pagination.previous') }}" class="inline-flex items-center px-3 py-2 text-slate-300">
<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
</svg>
</span>
@else
<a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="inline-flex items-center px-3 py-2 text-slate-500 transition hover:bg-slate-50 hover:text-slate-700" aria-label="{{ __('pagination.previous') }}">
<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
</svg>
</a>
@endif
@foreach ($elements as $element)
@if (is_string($element))
<span aria-disabled="true" class="inline-flex items-center border-l border-slate-200 px-4 py-2 text-sm font-medium text-slate-400">
{{ $element }}
</span>
@endif
@if (is_array($element))
@foreach ($element as $page => $url)
@if ($page == $paginator->currentPage())
<span aria-current="page" class="inline-flex items-center border-l border-slate-200 bg-slate-100 px-4 py-2 text-sm font-semibold text-slate-900">
{{ $page }}
</span>
@else
<a href="{{ $url }}" class="inline-flex items-center border-l border-slate-200 bg-white px-4 py-2 text-sm font-medium text-slate-700 transition hover:bg-slate-50" aria-label="{{ __('Go to page :page', ['page' => $page]) }}">
{{ $page }}
</a>
@endif
@endforeach
@endif
@endforeach
@if ($paginator->hasMorePages())
<a href="{{ $paginator->nextPageUrl() }}" rel="next" class="inline-flex items-center border-l border-slate-200 px-3 py-2 text-slate-500 transition hover:bg-slate-50 hover:text-slate-700" aria-label="{{ __('pagination.next') }}">
<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
</svg>
</a>
@else
<span aria-disabled="true" aria-label="{{ __('pagination.next') }}" class="inline-flex items-center border-l border-slate-200 px-3 py-2 text-slate-300">
<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
</svg>
</span>
@endif
</span>
</div>
</div>
</nav>
@endif