@extends($activeTemplate . 'layouts.frontend')

@section('content')
    @if (!request()->routeIs('knowledge'))
        @include('Template::partials.category_details')
    @else
        @include('Template::partials.knowledge_breadcrumb')
    @endif

    <section class="knowledge-base-section py-60">
        <div class="container">
            <div class="row gy-4">
                @forelse ($knowledgeList as $knowledge)
                    <div class="col-md-6">
                        <div class="knowledge-base-card">
                            <div class="knowledge-base-card-date mb-3">
                                <span class="title">@lang('Created!')</span>
                                <span class="value">{{ showDateTime($knowledge->created_at, 'M d, Y') }}</span>
                            </div>
                            <h4 class="mb-3">
                                <a href="{{ route('knowledge.details', $knowledge->id) }}">{{ __($knowledge->title) }}</a>
                            </h4>
                            <p class="knowledge-base-card-desc mb-4">{{ __($knowledge->subtitle) }}</p>

                            <a href="{{ route('knowledge.details', $knowledge->id) }}" class="knowledge-base-card-btn">
                                @lang('View Details') <i class="fa-solid fa-arrow-right fs-14"></i>
                            </a>
                        </div>
                    </div>
                @empty
                    <x-empty-message message="No knowledge base found" />
                @endforelse
                @if ($knowledgeList->hasPages())
                    <div class="pagination-wrapper">
                        {{ paginateLinks($knowledgeList) }}
                    </div>
                @endif
            </div>
    </section>

@endsection
