@extends('front-end.layouts.apps')

@section('title', 'د لټون پایلې')

@section('main_container')
    <div class="container" dir="rtl">
        {{-- د لټون فورمه --}}
        @include('front-end.poet-details.search')

        <div class="card mt-3" id="main_card">
            <div class="card-body">
                <h4 class="section-title">د لټون پایلې</h4>

                @if ($poetries->total() > 0)
                    <p class="text-muted">{{ $poetries->total() }} شعرونه وموندل شول</p>

                    @foreach ($poetries as $poetry)
                        <div class="search-result-card">
                            <div class="poetry-title">{{ $poetry->title }}</div>
                            <div class="poetry-meta">
                                <span><i class="fas fa-user"></i> {{ $poetry->poet->name ?? 'نامعلوم' }}</span>
                                <span><i class="fas fa-tag"></i> {{ $poetry->category->name_ps ?? 'نور' }}</span>
                            </div>
                            <div class="poetry-text">
                                {!! nl2br(e($poetry->poetry_text)) !!}
                            </div>
                        </div>
                    @endforeach

                    {{-- Pagination --}}
                    <div class="d-flex justify-content-center">
                       {{ $poetries->links('pagination::bootstrap-4') }} {{-- pagination links --}}
                        {{ $poetries->total() }} {{-- total number of records --}}
                        {{ $poetries->currentPage() }} {{-- current page number --}}
                    </div>
                @else
                    <div class="alert alert-warning text-center">
                        هیڅ شعر ونه موندل شو. مهرباني وکړئ بیا هڅه وکړئ.
                    </div>
                @endif
            </div>
        </div>
    </div>
@endsection

