@extends("layout.main")
@section("content")


<nav>
	<ul class="pagination justify-content-center my-2">
		@if ($page > 0)
			<!--keyboardinteraction keyname="p" target='/search/{{ $page - 1 }}' ></keyboardinteraction-->
			<li class="page-item"><a class="page-link" href='/search/{{ $page - 1 }}'>Previous</a></li>
		@else
			<li class="page-item disabled"><a class="page-link" href='/search/{{ $page - 1 }}'>Previous</a></li>
		@endif

		@for ($i = -4; $i <= 4; $i++) 

			@if ((($page + $i) < ($pages)) && (($page + $i) >= 0))
				@if ($i == 0)
					<li class="page-item active"><a class="page-link" href='/search/{{ $page + $i }}'>{{ $page + $i + 1}}</a></li>
				@else
					<li class="page-item"><a class="page-link" href='/search/{{ $page + $i }}'>{{ $page + $i + 1}}</a></li>
				@endif
			@endif

		@endfor

		@if ($page < $pages - 1)
			<li class="page-item"><a class="page-link" href='/search/{{ $page + 1 }}'>Next</a></li>
			<!--keyboardinteraction keyname="n" target='/search/{{ $page + 1 }}'></keyboardinteraction-->
		@else
			<li class="page-item disabled"><a class="page-link" href='/search/{{ $page + 1 }}'>Next</a></li>
		@endif
	</ul>
</nav>


<div class="row">
@foreach ($results as $rev) 
@if ($rev !== false)
@component("thumbnail_title", ["rev" => $rev])
@endcomponent
@endif
@endforeach
</div>

<nav>
	<ul class="pagination justify-content-center my-2">
		@if ($page > 0)
			<li class="page-item"><a class="page-link" href='/search/{{ $page - 1 }}'>Previous</a></li>
		@else
			<li class="page-item disabled"><a class="page-link" href='/search/{{ $page - 1 }}'>Previous</a></li>
		@endif

		@for ($i = -4; $i <= 4; $i++) 

			@if ((($page + $i) < ($pages)) && (($page + $i) >= 0))
				@if ($i == 0)
					<li class="page-item active"><a class="page-link" href='/search/{{ $page + $i }}'>{{ $page + $i + 1}}</a></li>
				@else
					<li class="page-item"><a class="page-link" href='/search/{{ $page + $i }}'>{{ $page + $i + 1}}</a></li>
				@endif
			@endif

		@endfor

		@if ($page < $pages - 1)
			<li class="page-item"><a class="page-link" href='/search/{{ $page + 1 }}'>Next</a></li>
		@else
			<li class="page-item disabled"><a class="page-link" href='/search/{{ $page + 1 }}'>Next</a></li>
		@endif
	</ul>
</nav>


@endsection
