<div class="container page-content clearfix">
    <div id="post-page" class="category-public-posts-page">
    	<div class="selected-hash-topic">
            <span class="selected-hash-topic-title">#{{$category_details->title}}</span> Blogs 
        </div>
    
        <div data-type="communitycategory-{{$typeId}}" data-offset="{{\Config::get('post-per-page')}}" id="post-list" data-url="{{$community->present()->url()}}/categoryposts/{{$typeId}}">        
            <?php \App\Performance\N1QueryOptimizer::primePostMediaForFeed($posts, ['communityId' => (int) ($community->id ?? 0), 'categoryId' => (int) ($typeId ?? 0)]); ?>
            @foreach($posts as $post)
                <?php                    
                    $communityOwnerActions='';
                    if(Auth::check()){                        
                        if($community->user_id==Auth::user()->id){
                            $communityOwnerActions='yes';
                        }
                    }
                ?>
                
                {{-- Use placeholder with self-contained lazy loading --}}
                {!! Theme::section('post.media', ['post' => $post,'communityOwnerActions' => $communityOwnerActions]) !!}              
            @endforeach
        </div>
        
        @if(count($posts))
            <div class="category-post-load">
                <a class="post-load-more" href="">{{trans('post.load-more')}}</a>
            </div>
        @endif
	</div>
    
    <div class="relevantPosts post-page-view">
    	 <button class="btn btn-success relevant-cateory-heading">RELEVANT CATEGORY</button>
         
         @if(count($relevantPosts)>0)
              @foreach($relevantPosts as $rpost)
                    @if($rpost->present()->canShow())
                        <div class="relevant-post feed-posts">
                            {!! Theme::section('post.topic-relevant-post', ['post' => $rpost]) !!}  
                        </div>
                    @endif     
              @endforeach 
         @endif     
    </div>

</div>
