
{{-- 분류/정렬/목록 수 --}}
@include('mobile.board.component.tab')

{{-- 공지사항 --}}
@include('mobile.board.component.notice')

{{-- 사진/동영상 게시글 --}}
@if($posts->total > 0)
    <section>
        <div class="row row-cols-1 row-cols-xxs-2 row-cols-sm-3 row-cols-md-4 row-cols-lg-5 row-cols-xl-6 gx-2 gy-3">
        @foreach($posts->list as $row)
            <div class="col">
                <figure class="figure h-100 d-flex flex-column">
                    <a href="{{ $row->viewURL }}" hreflang="ko" referrerpolicy="origin" type="text/html" class="ratio ratio-4x3">
                        @if($row->thumbnail)
                            <img src="{{ $row->thumbnail }}" class="figure-img img-fluid rounded object-fit-cover" alt="{{ $row->subject }}" onerror="{{ NO_IMAGE_NORMAL_SRC }}'"/>
                        @else
                            <img src="{{ NO_IMAGE_NORMAL_SRC }}" class="figure-img img-fluid rounded object-fit-cover" alt="No Image"/>
                        @endif
                    </a>
                    <figcaption class="figure-caption">
                        <p>
                            @if($boardMeta->use_category && $row->categoryName)
                                <label>
                                    <a href="{{ $listURL }}?category={{ $row->board_category_id }}" class="me-0" rel="search">
                                        [{{ $row->categoryName }}]
                                    </a>
                                </label>
                            @endif
                            @if($row->is_secret)
                                <a href="{{ $row->viewURL }}" hreflang="ko" referrerpolicy="origin" type="text/html" target="_self">
                                    <i class="fas fa-lock"></i> 비밀글입니다.
                                </a>
                            @elseif($row->isBlame)
                                <i class="fas fa-ban"></i> <del>{{ $row->subject }}</del>
                            @else
                                <a href="{{ $row->viewURL }}" hreflang="ko" referrerpolicy="origin" type="text/html" target="_self">{{ $row->subject }}</a>
                            @endif
                            @if($row->comment_rows > 0)
                                <var>[{{ $row->comment_rows }}]</var>
                            @endif
                            @if($row->file_rows > 0)
                                <i class="fas fa-save"></i>
                            @endif
                            @if($row->link_rows > 0)
                                <i class="fas fa-external-link-alt"></i>
                            @endif
                            @if($row->image_rows > 0)
                                <i class="fas fa-image"></i>
                            @endif
                            @if($row->isNew)
                                <span class="badge bg-warning text-dark">New</span>
                            @endif
                            @if($row->isHot)
                                <span class="badge bg-danger">Hot</span>
                            @endif
                        </p>
                    </figcaption>
                    <strong>{{ $row->user->name }}</strong>
                    <small>{{ $row->createdAt }}</small>
                    <ul>
                        <li>조회 <small>{{ $row->hit }}</small></li>
                        <li>좋아요 <small>{{ $row->like }}</small></li>
                    </ul>
                </figure>
            </div>
        @endforeach
        </div>
    </section>
@else
    <div class="p-5 text-center">
        게시글이 존재하지 않습니다.
    </div>
@endif

@if($posts->total > 0)
    <div class="pagination">
        {{ $posts->list->onEachSide($params->pageCount)->links('mobile.board.component.pagination') }}
    </div>
@endif
